From 87d5bd0229a81c199347e7b1a445a8a7472bbdd0 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Fri, 12 Jan 2024 03:17:01 -0800 Subject: [PATCH] remove player cast --- dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp b/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp index 23e0036d..c8563b53 100644 --- a/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp +++ b/dScripts/ai/MINIGAME/SG_GF/SERVER/SGCannon.cpp @@ -453,15 +453,10 @@ void SGCannon::SpawnNewModel(Entity* self) { void SGCannon::RemovePlayer(LWOOBJID playerID) { auto* player = Game::entityManager->GetEntity(playerID); - if (player == nullptr) - return; + if (!player) return; - auto* playerObject = dynamic_cast(player); - if (playerObject == nullptr) - return; - - auto* character = playerObject->GetCharacter(); - auto* characterComponent = playerObject->GetComponent(); + auto* character = player->GetCharacter(); + auto* characterComponent = player->GetComponent(); if (characterComponent && character) { characterComponent->SendToZone(character->GetLastNonInstanceZoneID()); }