Make AOE game condition causer use correct map time, fixes #210 #494
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In simple terms, this will fix issues with condition causers, like smoke spewer or psychic suppressor sites.
CompCauseGameCondition
iterates over the list of each maps that it affects, where it either creates the game condition, or updates the remaining ticks for it.The issue is that it uses
Find.TickManager.TicksGame
when doing so, which causes the affected maps to receive the time from either the world (if theThing
the comp is part of happens to be attached to a world object), or the specific map (if theThing
is spawned on an actual map).The change here is to properly use the actual ticks from the specific map that is affected.
A slight side note - this won't fix maps where the game condition is active, but the condition causer was destroyed. This is due to the condition causer updating the game condition, while the game condition itself does not have any references to the causer itself.