mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-16 20:24:39 -06:00
Compare commits
4 Commits
update-com
...
issue-1027
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e8af24572 | |||
| 051395e4c9 | |||
| 4ff5afd9f7 | |||
|
|
ce931c2cfe |
@@ -273,7 +273,7 @@ enum class eGameMessageType : uint16_t {
|
||||
TEAM_SET_LEADER = 1557,
|
||||
TEAM_INVITE_CONFIRM = 1558,
|
||||
TEAM_GET_STATUS_RESPONSE = 1559,
|
||||
TEAM_ADD_PLAYER = 1526,
|
||||
TEAM_ADD_PLAYER = 1562,
|
||||
TEAM_REMOVE_PLAYER = 1563,
|
||||
START_CELEBRATION_EFFECT = 1618,
|
||||
ADD_BUFF = 1647,
|
||||
|
||||
@@ -30,7 +30,7 @@ void SwitchBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bitStre
|
||||
|
||||
Game::logger->LogDebug("SwitchBehavior", "[%i] State: (%d), imagination: (%i) / (%f)", entity->GetLOT(), state, destroyableComponent->GetImagination(), destroyableComponent->GetMaxImagination());
|
||||
|
||||
if (state || (entity->GetLOT() == 8092 && destroyableComponent->GetImagination() >= m_imagination)) {
|
||||
if (state) {
|
||||
this->m_actionTrue->Handle(context, bitStream, branch);
|
||||
} else {
|
||||
this->m_actionFalse->Handle(context, bitStream, branch);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -196,18 +196,18 @@ void RebuildComponent::Update(float deltaTime) {
|
||||
DestroyableComponent* destComp = builder->GetComponent<DestroyableComponent>();
|
||||
if (!destComp) break;
|
||||
|
||||
int newImagination = destComp->GetImagination() - 1;
|
||||
int newImagination = destComp->GetImagination();
|
||||
if (newImagination <= 0) {
|
||||
CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
|
||||
break;
|
||||
}
|
||||
|
||||
++m_DrainedImagination;
|
||||
--newImagination;
|
||||
destComp->SetImagination(newImagination);
|
||||
EntityManager::Instance()->SerializeEntity(builder);
|
||||
|
||||
++m_DrainedImagination;
|
||||
|
||||
if (newImagination == 0 && m_DrainedImagination < m_TakeImagination) {
|
||||
CancelRebuild(builder, eQuickBuildFailReason::OUT_OF_IMAGINATION, true);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Timer >= m_CompleteTime && m_DrainedImagination >= m_TakeImagination) {
|
||||
|
||||
@@ -3891,7 +3891,7 @@ void GameMessages::HandleMessageBoxResponse(RakNet::BitStream* inStream, Entity*
|
||||
auto* racingControlComponent = entity->GetComponent<RacingControlComponent>();
|
||||
|
||||
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)) {
|
||||
|
||||
Reference in New Issue
Block a user