Inconsistency with 3-d floors
Posted: Wed Jan 31, 2007 18:41
http://nash.wanzafran.com/doomstuff/floorchecker.zip
The normal behaviour with Spawn() is that it'll fail to spawn anything if the spawned object does not have enough space to spawn.
However, with 3-d floors, the object will still get spawned, then it will be raised to the floor's surface.
In the example WAD, it is trying to detect whether the player is on ground or not. GetActorFloorZ can't be used because it will always return the distance from the real sector's floor, not the 3-d floor.
So a hack was made to solve this problem, by constantly spawning a 1-unit tall object underneat the player. If it is spawned, then the player is not on the ground. If it can't be spawned successfully, it means the player is on the ground.
If anything, this is just an inconsistency with the behaviour of spawned objects. Shouldn't it be destroyed if it can't spawn, just like real sector floors?
The normal behaviour with Spawn() is that it'll fail to spawn anything if the spawned object does not have enough space to spawn.
However, with 3-d floors, the object will still get spawned, then it will be raised to the floor's surface.
In the example WAD, it is trying to detect whether the player is on ground or not. GetActorFloorZ can't be used because it will always return the distance from the real sector's floor, not the 3-d floor.
So a hack was made to solve this problem, by constantly spawning a 1-unit tall object underneat the player. If it is spawned, then the player is not on the ground. If it can't be spawned successfully, it means the player is on the ground.
If anything, this is just an inconsistency with the behaviour of spawned objects. Shouldn't it be destroyed if it can't spawn, just like real sector floors?