MantisBT - Zandronum
View Issue Details
0000516Zandronum[All Projects] Bugpublic2011-07-13 23:412011-07-14 00:14
Positron 
Torr Samaho 
highmajoralways
closedno change required 
MicrosoftWindowsXP/Vista/7
98d 
 
0000516: thingCountName( "DoomPlayer", 0 )
When you want to count the number of alive players in the game, you might use the following statement: thingCountName( "DoomPlayer", 0 ). It works fine for the most part but breaks in some cases.

In coop, it breaks when someone spectates. For example: if you have two players in-game and one of them spectates, the function will continue to report that two players are in game. You can then rejoin the game and the count will get incremented to 3. Repeat to increase the count farther.

In Survival, the count includes eliminated players. It works fine when the player is in the death sequence but as soon as the player joins the spectating team, it starts to include the eliminated player.

I haven't tested this function in other game modes.
No tags attached.
Issue History
2011-07-13 23:41PositronNew Issue
2011-07-14 00:14Torr SamahoNote Added: 0001903
2011-07-14 00:14Torr SamahoStatusnew => closed
2011-07-14 00:14Torr SamahoAssigned To => Torr Samaho
2011-07-14 00:14Torr SamahoResolutionopen => no change required
2011-07-14 00:15Torr SamahoNote Edited: 0001903bug_revision_view_page.php?bugnote_id=1903#r953
2011-07-14 00:18Torr SamahoNote Edited: 0001903bug_revision_view_page.php?bugnote_id=1903#r954
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug

Notes
(0001903)
Torr Samaho   
2011-07-14 00:14   
(edited on: 2011-07-14 00:18)
Technically a spectator body is of type DoomPlayer (at least if the former player was of type DoomPlayer), so this is not a bug. You are trying to abuse a function for something that it's not intended to do. ThingCountName also counts voodoo dolls which is a clear indication that it's not doing what you want it to.

Use the ACS function PlayerCount instead. This should do what you need and is actually intended to do so.