Skip to content

Use slot indices in the PlayerList for conversions from player index to slot index #2897

Description

@Caball009

Int PlayerList::getSlotIndex(Int playerIndex) const
{
if (playerIndex >= 0 && playerIndex < ARRAY_SIZE(m_slotIndices))
{
return m_slotIndices[playerIndex];
}
return -1;
}

It should be possible to replace any code that does a conversion from player index to slot index with a call to PlayerList::getSlotIndex.

Incomplete list:

GameLogic::onLogicCrc

// "player%d":
ControlBar::populateObserverList
ConnectionManager::processChat
GameSpyStagingRoom::generateGameSpyGameResultsPacket
GameSpyStagingRoom::generateLadderGameResultsPacket
NetGameCommandMsg::constructGameMessage
Network::processDestroyPlayerCommand
RecorderClass::handleCRCMessage
PopulateInGameDiplomacyPopup
ToggleInGameChat
grabMultiPlayerInfo
InGameUI::drawPlayerInfoList
VictoryConditions::update
GameLogic::tryStartNewGame

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