From 95181b105865fecadd99979ad99e89dee89cbb69 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Sun, 27 Oct 2024 00:39:49 -0700 Subject: [PATCH] Fix build --- src/Chunking.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/Chunking.cpp b/src/Chunking.cpp index 4861ad5..61fc883 100644 --- a/src/Chunking.cpp +++ b/src/Chunking.cpp @@ -173,31 +173,37 @@ void Chunking::addEntityToChunks(std::set chnks, const EntityRef ref) { // notify this *player* of the existence of all visible Entities if (ref.kind == EntityKind::PLAYER && other->isExtant()) { + sPCAppearanceData pcData; + sNPCAppearanceData npcData; + sShinyAppearanceData eggData; + sTransportationAppearanceData busData; switch(otherRef.kind) { case EntityKind::PLAYER: - sPCAppearanceData pcData = dynamic_cast(other)->getAppearanceData(); + pcData = dynamic_cast(other)->getAppearanceData(); bufferAppearanceData(pcAppearances, pcData, MAX_PC_PER_AROUND); break; case EntityKind::SIMPLE_NPC: - sNPCAppearanceData npcData = dynamic_cast(other)->getAppearanceData(); + npcData = dynamic_cast(other)->getAppearanceData(); bufferAppearanceData(npcAppearances, npcData, MAX_NPC_PER_AROUND); break; case EntityKind::COMBAT_NPC: - sNPCAppearanceData combatNpcData = dynamic_cast(other)->getAppearanceData(); - bufferAppearanceData(npcAppearances, combatNpcData, MAX_NPC_PER_AROUND); + npcData = dynamic_cast(other)->getAppearanceData(); + bufferAppearanceData(npcAppearances, npcData, MAX_NPC_PER_AROUND); break; case EntityKind::MOB: - sNPCAppearanceData mobData = dynamic_cast(other)->getAppearanceData(); - bufferAppearanceData(npcAppearances, mobData, MAX_NPC_PER_AROUND); + npcData = dynamic_cast(other)->getAppearanceData(); + bufferAppearanceData(npcAppearances, npcData, MAX_NPC_PER_AROUND); break; case EntityKind::EGG: - sShinyAppearanceData shinyData = dynamic_cast(other)->getShinyAppearanceData(); - bufferAppearanceData(shinyAppearances, shinyData, MAX_SHINY_PER_AROUND); + eggData = dynamic_cast(other)->getShinyAppearanceData(); + bufferAppearanceData(shinyAppearances, eggData, MAX_SHINY_PER_AROUND); break; case EntityKind::BUS: - sTransportationAppearanceData transportationData = dynamic_cast(other)->getTransportationAppearanceData(); - bufferAppearanceData(transportationAppearances, transportationData, MAX_TRANSPORTATION_PER_AROUND); + busData = dynamic_cast(other)->getTransportationAppearanceData(); + bufferAppearanceData(transportationAppearances, busData, MAX_TRANSPORTATION_PER_AROUND); + break; + default: break; } } @@ -267,6 +273,8 @@ void Chunking::removeEntityFromChunks(std::set chnks, const EntityRef re id = dynamic_cast(other)->id; bufferIdForDisappearance(transportationDisappearances, id, MAX_IDS_PER_AROUND_DEL - 1); break; + default: + break; } }