diff --git a/dGame/dComponents/RacingControlComponent.cpp b/dGame/dComponents/RacingControlComponent.cpp index 3134d5fe..44c9de36 100644 --- a/dGame/dComponents/RacingControlComponent.cpp +++ b/dGame/dComponents/RacingControlComponent.cpp @@ -362,8 +362,7 @@ void RacingControlComponent::OnRacingPlayerInfoResetFinished(Entity* player) { } } -void RacingControlComponent::HandleMessageBoxResponse(Entity* player, - const std::string& id) { +void RacingControlComponent::HandleMessageBoxResponse(Entity* player, int32_t button, const std::string& id) { auto* data = GetPlayerData(player->GetObjectID()); if (data == nullptr) { @@ -405,7 +404,7 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player, missionComponent->Progress(eMissionTaskType::RACING, dZoneManager::Instance()->GetZone()->GetWorldID(), (LWOOBJID)eRacingTaskParam::LAST_PLACE_FINISH); // Finished first place in specific world. } } - } else if (id == "ACT_RACE_EXIT_THE_RACE?" || id == "Exit") { + } else if (id == "ACT_RACE_EXIT_THE_RACE?" && button == m_ActivityExitConfirm) { auto* vehicle = EntityManager::Instance()->GetEntity(data->vehicleID); if (vehicle == nullptr) { diff --git a/dGame/dComponents/RacingControlComponent.h b/dGame/dComponents/RacingControlComponent.h index 91ab2fd4..a81121e1 100644 --- a/dGame/dComponents/RacingControlComponent.h +++ b/dGame/dComponents/RacingControlComponent.h @@ -144,7 +144,7 @@ public: /** * Invoked when the player responds to the GUI. */ - void HandleMessageBoxResponse(Entity* player, const std::string& id); + void HandleMessageBoxResponse(Entity* player, int32_t button, const std::string& id); /** * Get the racing data from a player's LWOOBJID. @@ -246,4 +246,9 @@ private: float m_EmptyTimer; bool m_SoloRacing; + + /** + * Value for message box response to know if we are exiting the race via the activity dialogue + */ + const int32_t m_ActivityExitConfirm = 1; }; diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index caab6459..99b1c67f 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -3891,7 +3891,7 @@ void GameMessages::HandleMessageBoxResponse(RakNet::BitStream* inStream, Entity* auto* racingControlComponent = entity->GetComponent(); if (racingControlComponent != nullptr) { - racingControlComponent->HandleMessageBoxResponse(userEntity, GeneralUtils::UTF16ToWTF8(identifier)); + racingControlComponent->HandleMessageBoxResponse(userEntity, iButton, GeneralUtils::UTF16ToWTF8(identifier)); } for (auto* shootingGallery : EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SHOOTING_GALLERY)) {