mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-26 15:00:06 +00:00
added a chunk sanity check
removed unneccesary include
This commit is contained in:
parent
d102fabc2f
commit
f733aa60f0
@ -917,6 +917,11 @@ void NPCManager::eggPickup(CNSocket* sock, CNPacketData* data) {
|
|||||||
return;
|
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;
|
int typeId = egg->appearanceData.iNPCType;
|
||||||
if (EggTypes.find(typeId) == EggTypes.end()) {
|
if (EggTypes.find(typeId) == EggTypes.end()) {
|
||||||
if (egg->npcClass != NPCClass::NPC_EGG) {
|
if (egg->npcClass != NPCClass::NPC_EGG) {
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <unordered_map>
|
|
||||||
|
|
||||||
#include "CNProtocol.hpp"
|
#include "CNProtocol.hpp"
|
||||||
#include "CNStructs.hpp"
|
#include "CNStructs.hpp"
|
||||||
|
@ -625,7 +625,6 @@ void TableData::loadGruntwork(int32_t *nextId) {
|
|||||||
NPCManager::Eggs[id] = addEgg;
|
NPCManager::Eggs[id] = addEgg;
|
||||||
NPCManager::updateNPCPosition(id, egg["iX"], egg["iY"], egg["iZ"], egg["iMapNum"]);
|
NPCManager::updateNPCPosition(id, egg["iX"], egg["iY"], egg["iZ"], egg["iMapNum"]);
|
||||||
TableData::RunningEggs[id] = addEgg;
|
TableData::RunningEggs[id] = addEgg;
|
||||||
std::cout << id << " " << addEgg->currentChunks.size() << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user