Fix for edge case with roambox water logic

This commit is contained in:
Akkadius 2018-09-03 02:11:39 -05:00
parent b92e83a465
commit 6fc20939e8

View File

@ -1702,6 +1702,14 @@ void NPC::AI_DoMovement() {
(m_Position.z - 15)
);
/**
* If someone brought us into water when we naturally wouldn't path there, return to spawn
*/
if (zone->watermap->InLiquid(position) && zone->watermap->InLiquid(m_Position)) {
roambox_destination_x = m_SpawnPoint.x;
roambox_destination_y = m_SpawnPoint.y;
}
if (zone->watermap->InLiquid(position)) {
Log(Logs::Detail,
Logs::NPCRoamBox, "%s | My destination is in water and I don't belong there!",