From 2bddef7af2e1fd01186188947fb685a47b228e3c Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Wed, 31 Mar 2010 23:51:16 -0400 Subject: A hack to prevent NPCs from walking off screen on ManaServ This should really be fixed a different way, but until I find the cause of the issue, this will have to hold. --- src/being.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 72bdef3d..1d9047d1 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -590,6 +590,10 @@ void Being::logic() mDest : Vector(mPath.front().x, mPath.front().y); + // This is a hack that stops NPCs from running off the map... + if (mDest.x <= 0 && mDest.y <= 0) + return; + // The Vector representing the difference between current position // and the next destination path node. Vector dir = dest - mPos; -- cgit v1.2.3-70-g09d2