Skip to content

Refactored player status code (i.e. chatting, in console/menu, etc.) and added new ACS function: "GetPlayerStatus"

Adam Kaminski requested to merge topic/default/acs-getplayerstatus into branch/default
  1. 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 called player_t::statusFlags, where each status occupies its own bit.

  2. 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 of PLAYER_SetStatus and back to where they originally were (i.e. C_ToggleConsole, M_StartControlPanel and M_ClearMenus).

  3. 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.

Edited by Adam Kaminski

Merge request reports