diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index df52e0f..72a3f96 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -917,6 +917,11 @@ void NPCManager::eggPickup(CNSocket* sock, CNPacketData* data) { return; } + if (egg->chunkPos != ChunkManager::grabChunk(plr->x, plr->y, plr->instanceID)) { + std::cout << "[WARN] Player tried to open an egg from the other chunk?!" << std::endl; + return; + } + int typeId = egg->appearanceData.iNPCType; if (EggTypes.find(typeId) == EggTypes.end()) { if (egg->npcClass != NPCClass::NPC_EGG) { diff --git a/src/Player.hpp b/src/Player.hpp index 9962f83..714250b 100644 --- a/src/Player.hpp +++ b/src/Player.hpp @@ -2,7 +2,6 @@ #include #include -#include #include "CNProtocol.hpp" #include "CNStructs.hpp" diff --git a/src/TableData.cpp b/src/TableData.cpp index bc9e4e6..79e9a55 100644 --- a/src/TableData.cpp +++ b/src/TableData.cpp @@ -625,7 +625,6 @@ void TableData::loadGruntwork(int32_t *nextId) { NPCManager::Eggs[id] = addEgg; NPCManager::updateNPCPosition(id, egg["iX"], egg["iY"], egg["iZ"], egg["iMapNum"]); TableData::RunningEggs[id] = addEgg; - std::cout << id << " " << addEgg->currentChunks.size() << std::endl; }