mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-02-11 14:50:03 +00:00
Use direct members instead of pointers for viewableChunks and buyback
We had avoided putting STL containers into Players back when we thought Players was still POD and needed to remain POD, but it turned out that neither were the case all along, so there's no need for the indirection.
This commit is contained in:
@@ -66,7 +66,6 @@ void NPCManager::destroyNPC(int32_t id) {
|
||||
Eggs::Eggs.erase(id);
|
||||
|
||||
// finally, remove it from the map and free it
|
||||
delete entity->viewableChunks;
|
||||
NPCs.erase(id);
|
||||
delete entity;
|
||||
}
|
||||
@@ -86,7 +85,7 @@ void NPCManager::updateNPCPosition(int32_t id, int X, int Y, int Z, uint64_t I,
|
||||
}
|
||||
|
||||
void NPCManager::sendToViewable(BaseNPC *npc, void *buf, uint32_t type, size_t size) {
|
||||
for (auto it = npc->viewableChunks->begin(); it != npc->viewableChunks->end(); it++) {
|
||||
for (auto it = npc->viewableChunks.begin(); it != npc->viewableChunks.end(); it++) {
|
||||
Chunk* chunk = *it;
|
||||
for (CNSocket *s : chunk->players) {
|
||||
s->sendPacket(buf, type, size);
|
||||
|
||||
Reference in New Issue
Block a user