HomeWildfire Games

Workaround TriggerHelper.js not being able to spawn units correctly because of…

Description

Workaround TriggerHelper.js not being able to spawn units correctly because of promotion.
Avoid duplication by moving the function to Transform.js.
Add tests to Transform.js
Add tests to TurretHolder.js
Optimize slightly Trainer.js by removing some useless Engine.QueryInterface calls.
Refs #6784 (symptoms in TriggerHelper.js are fixed underlying cause not)

SkirmishReplacer is called before the Modifier Manager so it does not suffer the same fate.
Entities using ChangeEntityTemplate function are still affected.
Maps calling Engine.AddEntity directly are still affected.

Ideally this should be handled by hotloading components instead of creating new entities each time. See => https://code.wildfiregames.com/D4991
Tested using: https://github.com/0ADMods/trailer_tools/commit/908dd631d950b5050d1784530c65f29ccfc67913

Differential Revision: https://code.wildfiregames.com/D4984