mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-11 11:10:14 +00:00
[refactor] Split MobManager.cpp into MobAI.cpp and Combat.cpp
This is terrible. It was a mistake to do this before cleaning up the actual code. It might be better not to use this commit and to do this refactor in a different order or something.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "NPCManager.hpp"
|
||||
#include "ItemManager.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "MobManager.hpp"
|
||||
#include "Combat.hpp"
|
||||
#include "MissionManager.hpp"
|
||||
#include "ChunkManager.hpp"
|
||||
#include "NanoManager.hpp"
|
||||
@@ -79,8 +79,8 @@ void NPCManager::destroyNPC(int32_t id) {
|
||||
ChunkManager::removeNPCFromChunks(ChunkManager::getViewableChunks(entity->chunkPos), id);
|
||||
|
||||
// remove from mob manager
|
||||
if (MobManager::Mobs.find(id) != MobManager::Mobs.end())
|
||||
MobManager::Mobs.erase(id);
|
||||
if (MobAI::Mobs.find(id) != MobAI::Mobs.end())
|
||||
MobAI::Mobs.erase(id);
|
||||
|
||||
// remove from eggs
|
||||
if (Eggs.find(id) != Eggs.end())
|
||||
@@ -538,7 +538,7 @@ BaseNPC *NPCManager::summonNPC(int x, int y, int z, uint64_t instance, int type,
|
||||
|
||||
if (team == 2) {
|
||||
npc = new Mob(x, y, z + EXTRA_HEIGHT, inst, type, NPCData[type], id);
|
||||
MobManager::Mobs[id] = (Mob*)npc;
|
||||
MobAI::Mobs[id] = (Mob*)npc;
|
||||
|
||||
// re-enable respawning, if desired
|
||||
((Mob*)npc)->summoned = !respawn;
|
||||
|
||||
Reference in New Issue
Block a user