Add another layer of randomization to roam box logic, npc's who weren't originally spawned in water won't roambox into water

This commit is contained in:
Akkadius
2018-08-18 22:01:46 -05:00
parent 4b6ab34fd9
commit 834062fbf9
7 changed files with 61 additions and 8 deletions
+10
View File
@@ -39,6 +39,7 @@
#include "raids.h"
#include "string_ids.h"
#include "worldserver.h"
#include "water_map.h"
#ifdef _WINDOWS
#define snprintf _snprintf
@@ -686,6 +687,15 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
}
}
/**
* Set whether NPC was spawned in or out of water
*/
if (zone->HasMap() && zone->HasWaterMap()) {
npc->SetSpawnedInWater(false);
if (zone->watermap->InLiquid(npc->GetPosition())) {
npc->SetSpawnedInWater(true);
}
}
}
void EntityList::AddMerc(Merc *merc, bool SendSpawnPacket, bool dontqueue)