[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:
2021-03-13 23:55:16 +01:00
parent ae279100d7
commit 2024fb4969
16 changed files with 1315 additions and 1297 deletions

View File

@@ -2,7 +2,7 @@
#include "PlayerManager.hpp"
#include "NPCManager.hpp"
#include "settings.hpp"
#include "MobManager.hpp"
#include "Combat.hpp"
std::map<ChunkPos, Chunk*> ChunkManager::chunks;
@@ -465,7 +465,7 @@ void ChunkManager::createInstance(uint64_t instanceID) {
Mob* newMob = new Mob(baseNPC->appearanceData.iX, baseNPC->appearanceData.iY, baseNPC->appearanceData.iZ, baseNPC->appearanceData.iAngle,
instanceID, baseNPC->appearanceData.iNPCType, NPCManager::NPCData[baseNPC->appearanceData.iNPCType], NPCManager::nextId++);
NPCManager::NPCs[newMob->appearanceData.iNPC_ID] = newMob;
MobManager::Mobs[newMob->appearanceData.iNPC_ID] = newMob;
MobAI::Mobs[newMob->appearanceData.iNPC_ID] = newMob;
// if in a group, copy over group members as well
if (((Mob*)baseNPC)->groupLeader != 0) {
@@ -480,7 +480,7 @@ void ChunkManager::createInstance(uint64_t instanceID) {
instanceID, baseFollower->appearanceData.iNPCType, NPCManager::NPCData[baseFollower->appearanceData.iNPCType], followerID);
// add follower to NPC maps
NPCManager::NPCs[followerID] = newMobFollower;
MobManager::Mobs[followerID] = newMobFollower;
MobAI::Mobs[followerID] = newMobFollower;
// set follower-specific properties
newMobFollower->groupLeader = newMob->appearanceData.iNPC_ID;
newMobFollower->offsetX = ((Mob*)baseFollower)->offsetX;