Set 'raise_built' and 'raise_destroy' to let other mods know when you modify their entities. #11
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.
One of my mods (Turret Shields) was having problems with yours (Hero Turrets). Long story short, you were not sending the raise_built and raise_destroy flags when you destroyed/built entities during a turret upgrade. These events allow other mods (mine) to know that something happened to their entities.
What was happening without these flags was that my array of turrets (keyed by unitID) was having the entities it referred to removed, but without the cleanup process my own code does to remove the shield entity when the turret goes away. This ended up meaning that upgraded turrets had no shields and there were lots of dangling shield entities on the map as more and more turrets got upgraded. These two changes completely remove this problem.
Only two lines of code were actually changed:
`diff --git a/ModMash/HeroTurrets/prototypes/scripts/turrets.lua b/ModMash/HeroTurrets/prototypes/scripts/turrets.lua
index bac6fa1..f32c31f 100644
--- a/ModMash/HeroTurrets/prototypes/scripts/turrets.lua
+++ b/ModMash/HeroTurrets/prototypes/scripts/turrets.lua
@@ -45,8 +45,8 @@ local local_replace_turret = function(entity,recipe)
c = i.get_contents()
end
`
Everything else was bringing the code I got from forking your repo up to date with the code that was in the current release version of the mod (your repo has 1.24; the release version is 1.26).