#3238 closed defect (fixed)
[PATCH] Don't load trigger scripts twice
Reported by: | Stan | Owned by: | trompetin17 |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 19 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
When loading gallic fields I get this error
ERROR: JavaScript error: maps/scripts/TriggerHelper.js line 165
Error: SetGlobal "TriggerHelper" called multiple times
r16713 fixed the problem above but broke the serialization test mode.
Attachments (1)
Change History (10)
comment:1 by , 9 years ago
Summary: | Trigger Js Error → Trigger Helper Js Error |
---|
comment:2 by , 9 years ago
comment:4 by , 9 years ago
It's bacause the new conquest also needs the TriggerHelper functions, and thus the script is loaded twice. Once as part of the victory-scripts, and once as part of the trigger scripts.
Removing it from the trigger scripts list is no option either, since the player can choose the victory type, and f.e. prefer the Wonder or Endless game mode, which doesn't load the TriggerHelper.
Apparently, the TriggerHelper in the conquest scripts is only used to check some classes of entities, which can be done via an extra line of code too.
Another option is to make the list unique in the gamesetup.
comment:6 by , 9 years ago
Component: | UI & Simulation → Core engine |
---|---|
Description: | modified (diff) |
Keywords: | patch review added |
Milestone: | Backlog → Alpha 19 |
Priority: | Should Have → Nice to Have |
Resolution: | fixed |
Status: | closed → reopened |
Summary: | Trigger Helper Js Error → [PATCH] Don't load trigger scripts twice |
The fix above breaks the serialization test mode.
For instance, on Greek Acropolis (2), on the second play of the first turn, ConquestStartGameCount (defined in ConquestCommon.js) is called by DoAfterDelay (requested in Conquest.js) but doesn't exist, probably because the script was not reloaded.
Attached patch is a fix proposal, but maybe there is a less hacky way to do that (e.g. by properly checking that the script has been loaded in the good simulation instance).
by , 9 years ago
Attachment: | trigger-STmode.patch added |
---|
comment:9 by , 9 years ago
Keywords: | patch review removed |
---|
I also have this error, but not on belgian bog (which has no error), but on gallic fields.