Skip to content

Commit e95a81c

Browse files
committed
3.0.2, fixing saving the name->cmdID mapping by doing registraiton of the owner before we filter out commands by owner [https://trello.com/c/TKpg1KnG/]
1 parent aee42a5 commit e95a81c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

customCommands.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ customCommands = {
9292
customCommandsIDToName[cmdID] = internalCmdName -- reverse mapping
9393
gadgetHandler:RegisterCMDID(cmdID)
9494

95-
-- name to cmdID mapping
96-
local encodedCustomCommandsNameToID = customCommands.EncodeLocalNameToID(customCommandsNameToID, playerID)
97-
message.SendSyncedInfoTeamPacked("CustomCommandsNameToID", encodedCustomCommandsNameToID , teamID) -- save mapping to global variable so any widget can reload it from there
98-
9995
-- register owner player and owner team
10096
customCommandsNameToPlayerID[internalCmdName] = playerID
10197
customCommandsNameToTeamID[internalCmdName] = teamID
10298

10399
-- increase commands counter
104100
customCommandsCountsPerTeam[teamID] = customCommandsCountsPerTeam[teamID] + 1
101+
102+
-- name to cmdID mapping
103+
local encodedCustomCommandsNameToID = customCommands.EncodeLocalNameToID(customCommandsNameToID, playerID)
104+
message.SendSyncedInfoTeamPacked("CustomCommandsNameToID", encodedCustomCommandsNameToID , teamID) -- save mapping to global variable so any widget can reload it from there
105105
else -- already existing
106106
-- we remove all existing instance of old command to make sure it is not forgotten
107107
customCommands.RemoveCustomCommandFromAllUnits(cmdName, playerID)

0 commit comments

Comments
 (0)