mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-20 13:21:28 +00:00
Make the AI stopping a little less silly on zone shutdown
This commit is contained in:
parent
00ba6e761e
commit
5b78acc45e
@ -4668,3 +4668,10 @@ Mob *EntityList::GetTargetForVirus(Mob *spreader, int range)
|
|||||||
return TargetsInRange[zone->random.Int(0, TargetsInRange.size() - 1)];
|
return TargetsInRange[zone->random.Int(0, TargetsInRange.size() - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityList::StopMobAI()
|
||||||
|
{
|
||||||
|
for (auto &mob : mob_list) {
|
||||||
|
mob.second->AI_Stop();
|
||||||
|
mob.second->AI_ShutDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -268,6 +268,8 @@ public:
|
|||||||
Entity *GetEntityMob(const char *name);
|
Entity *GetEntityMob(const char *name);
|
||||||
Entity *GetEntityCorpse(const char *name);
|
Entity *GetEntityCorpse(const char *name);
|
||||||
|
|
||||||
|
void StopMobAI();
|
||||||
|
|
||||||
void DescribeAggro(Client *towho, NPC *from_who, float dist, bool verbose);
|
void DescribeAggro(Client *towho, NPC *from_who, float dist, bool verbose);
|
||||||
|
|
||||||
void Message(uint32 to_guilddbid, uint32 type, const char* message, ...);
|
void Message(uint32 to_guilddbid, uint32 type, const char* message, ...);
|
||||||
|
|||||||
@ -662,15 +662,7 @@ void Zone::Shutdown(bool quite)
|
|||||||
if (!ZoneLoaded)
|
if (!ZoneLoaded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::list<Mob*> mob_list;
|
entity_list.StopMobAI();
|
||||||
entity_list.GetMobList(mob_list);
|
|
||||||
std::list<Mob*>::iterator mob_itr = mob_list.begin();
|
|
||||||
while (mob_itr != mob_list.end()) {
|
|
||||||
Mob* mob_inst = *mob_itr;
|
|
||||||
mob_inst->AI_Stop();
|
|
||||||
mob_inst->AI_ShutDown();
|
|
||||||
++mob_itr;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<uint32,NPCType *>::iterator itr;
|
std::map<uint32,NPCType *>::iterator itr;
|
||||||
while(zone->npctable.size()) {
|
while(zone->npctable.size()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user