Refactored player status code (i.e. chatting, in console/menu, etc.) and added new ACS function: "GetPlayerStatus"
-
This refactors the code that handles all of the player's statuses. Instead of each status being a separate boolean in the
player_t
struct, I combined them into a new bitfield variable calledplayer_t::statusFlags
, where each status occupies its own bit. -
While refactoring the code, I also noticed that a player's statuses didn't updating properly in clientside demos. 850eeed37215 introduced this regression, so the best thing to do was move the
( CLIENTDEMO_IsPlaying( ) == false )
checks out ofPLAYER_SetStatus
and back to where they originally were (i.e.C_ToggleConsole
,M_StartControlPanel
andM_ClearMenus
). -
This adds a new ACS function that returns a bitfield containing all of the player's active statuses:
-
PLAYERSTATUS_CHATTING
(1): the player is typing a chat message. -
PLAYERSTATUS_TALKING
(2): the player is talking on the microphone. -
PLAYERSTATUS_INCONSOLE
(4): the player is in the console. -
PLAYERSTATUS_INMENU
(8): the player is in the menu. -
PLAYERSTATUS_LAGGING
(16): the player is lagging.
Note that checking the player's "ready to go" status is irrelevant here, since this status is only applicable to the intermission screen and can't be used in an ACS script.