mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
fix: not exiting shooting gallery when clicking activity close button
Fixes #436 Fixes crash when replaying as well
This commit is contained in:
@@ -91,6 +91,7 @@
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "eClientMessageType.h"
|
||||
#include "eGameMessageType.h"
|
||||
#include "ActivityManager.h"
|
||||
|
||||
#include "CDComponentsRegistryTable.h"
|
||||
#include "CDObjectsTable.h"
|
||||
@@ -6204,3 +6205,18 @@ void GameMessages::SendShowBillboardInteractIcon(const SystemAddress& sysAddr, L
|
||||
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST
|
||||
else SEND_PACKET
|
||||
}
|
||||
|
||||
void GameMessages::HandleRequestActivityExit(RakNet::BitStream* inStream, Entity* entity) {
|
||||
bool canceled = false;
|
||||
inStream->Read(canceled);
|
||||
if (!canceled) return;
|
||||
|
||||
LWOOBJID player_id = LWOOBJID_EMPTY;
|
||||
inStream->Read(player_id);
|
||||
auto player = EntityManager::Instance()->GetEntity(player_id);
|
||||
if (!entity || !player) return;
|
||||
|
||||
for (auto* shootingGallery : EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::SHOOTING_GALLERY)) {
|
||||
shootingGallery->RequestActivityExit(entity, player_id, true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user