Skip to content

Debug / cheat feature to switch between players in skirmish mode breaks replay CRC #3213

Description

@Caball009

These are debug / cheat game messages to switch between players in skirmish mode:

GameMessage::MSG_CHEAT_SWITCH_TEAMS
GameMessage::MSG_META_DEMO_SWITCH_TEAMS
GameMessage::MSG_META_DEMO_SWITCH_TEAMS_BETWEEN_CHINA_USA

They change the local player by calling rts::changeLocalPlayer. This causes the replay to mismatch, because MSG_LOGIC_CRC messages are now created with the new local player index instead of the original local player index:

GameMessage *msg = newInstance(GameMessage)(GameMessage::MSG_LOGIC_CRC);

GameMessage::GameMessage( GameMessage::Type type )
{
m_playerIndex = ThePlayerList->getLocalPlayer()->getPlayerIndex();


AFAICT MSG_LOGIC_CRC messages should always use the original local player index, not whatever it may be changed to. Using the original player index fixes this bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions