Don't set spectator flags on dead player objects
Currently in Odamex, when a player spectates, their associated mobj is made invisible.
There is no need to remove a corpse when a player spectates, and in the survival mode that I'm making, where players are forced to spectate if they run out of lives, this behavior causes the player to just disappear when they die on their last life.
The following patch works around this by adding a "deadspectator" flag that is set on the player when they spectate while dead. This alters the behavior of the respawning code, to make it silently respawn the spectator in the same position as their corpse, leaving it behind.
Created attachment 494 [details]
don't set spectator flags on a dead player object
r4867 applies this patch.
Is this implemented as intended?
This patch has been in since 2014, we don't seem to have any issues, and the original reporter never followed up. Marking fixed.
This remains unresolved. The changes my patch made were commented out in commit 0fe6548 and were never reenabled.
Indeed, I also noticed these lines are commented out. I guess it'll be reenabled jut before the 0.8 release...
I'd believe those were reserved for the future survival mode, but other than that, was it used somewhere else to fix any specific behaviour ?
Outside of survival, the deadspectator flag prevents a player corpse from disappearing if they spectate while dead, prior to respawning, which is a fairly minor issue overall. In survival mode, though, the deadspectator flag prevents some pretty jarring behavior, where players would just disappear the instant they lost their last life, without even going through the death animation. If I recall correctly, the flag also has the additional purpose of distinguishing between normal spectators and players forced to spectate upon death. The latter group being respawned automatically when a new round starts up.
So yep, according to Kyle's description of the issue, there was seriously no reason to comment those lines out.