Spawning something via ACS (or the old Thing_Spawn* functions, which can be line specials by themselves) completely ignores e.IsFinal being explicitly set to 'true'.
In this test PK3, ZombieMan is replaced with ShotgunGuy via CheckReplacemet(), with e.IsFinal being true.
ShotgunGuy is replaced by a Cacodemon copy via the 'replaces' keyword.
In the test map, one zombieman is placed via map editor, it gets replaced with a shotgunner as it should be. There are three mapspots which a ACS script will also spawn zombiemen at. However, it is here where e.IsFinal is ignored and cacodemons spawn instead. The ACS script uses various spawning functions.
I think I've narrowed it down to these three: P_Thing_Spawn, P_Thing_Projectile and DLevelScript::DoSpawn
In particular, each of them has this pattern:
Code: Select all
kind = kind->GetReplacement(); //This is called first
....
actor = Spawn (kind, pos, ALLOW_REPLACE); //ALLOW_REPLACE ensures GetReplacement() is called again