Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/Common/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ class Player : public Snapshot
ScoreKeeper* getScoreKeeper( void ) { return &m_scoreKeeper; }

/// time to create a hotkey team based on this GameMessage
void processCreateTeamGameMessage(Int hotkeyNum, GameMessage *msg);
void processCreateTeamGameMessage(Int hotkeyNum, const GameMessage *msg);

/// time to select a hotkey team based on this GameMessage
void processSelectTeamGameMessage(Int hotkeyNum, GameMessage *msg);
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Source/Common/RTS/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,7 @@ void Player::applyBattlePlanBonusesForPlayerObjects( const BattlePlanBonuses *bo
//-------------------------------------------------------------------------------------------------
/** Create a hotkey team based on this GameMessage */
//-------------------------------------------------------------------------------------------------
void Player::processCreateTeamGameMessage(Int hotkeyNum, GameMessage *msg) {
void Player::processCreateTeamGameMessage(Int hotkeyNum, const GameMessage *msg) {
// GameMessage arguments are the object ID's of the objects that are to be in this team.

if ((hotkeyNum < 0) || (hotkeyNum >= NUM_HOTKEY_SQUADS)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,26 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
break;
}

// --------------------------------------------------------------------------------------------
case GameMessage::MSG_CREATE_TEAM0:
case GameMessage::MSG_CREATE_TEAM1:
case GameMessage::MSG_CREATE_TEAM2:
case GameMessage::MSG_CREATE_TEAM3:
case GameMessage::MSG_CREATE_TEAM4:
case GameMessage::MSG_CREATE_TEAM5:
case GameMessage::MSG_CREATE_TEAM6:
case GameMessage::MSG_CREATE_TEAM7:
case GameMessage::MSG_CREATE_TEAM8:
case GameMessage::MSG_CREATE_TEAM9:
{
Int playerIndex = msg->getPlayerIndex();
Player* player = ThePlayerList->getNthPlayer(playerIndex);
if (player && player->isLocalPlayer())
player->processCreateTeamGameMessage(t - GameMessage::MSG_CREATE_TEAM0, msg);

break;
}

// --------------------------------------------------------------------------------------------
case GameMessage::MSG_CREATE_SELECTED_GROUP:
case GameMessage::MSG_SELECT_TEAM0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1901,12 +1901,10 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Player *player = ThePlayerList->getNthPlayer(playerIndex);
DEBUG_ASSERTCRASH(player != NULL, ("Could not find player for create team message"));

if (player == NULL)
{
break;
}
// TheSuperHackers @tweak Stubbjax 17/08/2025 The local player processes this message in CommandXlat for immediate assignment.
if (player && !player->isLocalPlayer())
player->processCreateTeamGameMessage(msg->getType() - GameMessage::MSG_CREATE_TEAM0, msg);

player->processCreateTeamGameMessage(msg->getType() - GameMessage::MSG_CREATE_TEAM0, msg);
break;
} // end create team command

Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Include/Common/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ class Player : public Snapshot
ScoreKeeper* getScoreKeeper( void ) { return &m_scoreKeeper; }

/// time to create a hotkey team based on this GameMessage
void processCreateTeamGameMessage(Int hotkeyNum, GameMessage *msg);
void processCreateTeamGameMessage(Int hotkeyNum, const GameMessage *msg);

/// time to select a hotkey team based on this GameMessage
void processSelectTeamGameMessage(Int hotkeyNum, GameMessage *msg);
Expand Down
2 changes: 1 addition & 1 deletion GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3682,7 +3682,7 @@ void Player::applyBattlePlanBonusesForPlayerObjects( const BattlePlanBonuses *bo
//-------------------------------------------------------------------------------------------------
/** Create a hotkey team based on this GameMessage */
//-------------------------------------------------------------------------------------------------
void Player::processCreateTeamGameMessage(Int hotkeyNum, GameMessage *msg) {
void Player::processCreateTeamGameMessage(Int hotkeyNum, const GameMessage *msg) {
// GameMessage arguments are the object ID's of the objects that are to be in this team.

if ((hotkeyNum < 0) || (hotkeyNum >= NUM_HOTKEY_SQUADS)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3610,6 +3610,26 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
break;
}

// --------------------------------------------------------------------------------------------
case GameMessage::MSG_CREATE_TEAM0:
case GameMessage::MSG_CREATE_TEAM1:
case GameMessage::MSG_CREATE_TEAM2:
case GameMessage::MSG_CREATE_TEAM3:
case GameMessage::MSG_CREATE_TEAM4:
case GameMessage::MSG_CREATE_TEAM5:
case GameMessage::MSG_CREATE_TEAM6:
case GameMessage::MSG_CREATE_TEAM7:
case GameMessage::MSG_CREATE_TEAM8:
case GameMessage::MSG_CREATE_TEAM9:
{
Int playerIndex = msg->getPlayerIndex();
Player* player = ThePlayerList->getNthPlayer(playerIndex);
if (player && player->isLocalPlayer())
player->processCreateTeamGameMessage(t - GameMessage::MSG_CREATE_TEAM0, msg);

break;
}

// --------------------------------------------------------------------------------------------
case GameMessage::MSG_CREATE_SELECTED_GROUP:
case GameMessage::MSG_SELECT_TEAM0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1929,12 +1929,10 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData )
Player *player = ThePlayerList->getNthPlayer(playerIndex);
DEBUG_ASSERTCRASH(player != NULL, ("Could not find player for create team message"));

if (player == NULL)
{
break;
}
// TheSuperHackers @tweak Stubbjax 17/08/2025 The local player processes this message in CommandXlat for immediate assignment.
if (player && !player->isLocalPlayer())
player->processCreateTeamGameMessage(msg->getType() - GameMessage::MSG_CREATE_TEAM0, msg);

player->processCreateTeamGameMessage(msg->getType() - GameMessage::MSG_CREATE_TEAM0, msg);
break;
} // end create team command

Expand Down
Loading