From 05c98dad6bca7f0bcae2a09a12f4863dac546e22 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 2 May 2016 22:41:40 -0500 Subject: puuuuurfct --- src/creature.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/creature.cpp') diff --git a/src/creature.cpp b/src/creature.cpp index 3b26f63..cc7fb3e 100644 --- a/src/creature.cpp +++ b/src/creature.cpp @@ -27,7 +27,7 @@ void Creature::Behavior() } void Creature::Priority() -{ +{ for(list ::iterator it = N.begin(); it!=N.end(); it++){ if((*it)->getType() == 2){ if(!hasTarget){ @@ -62,8 +62,12 @@ void Creature::Action() hasTarget = false; } } - else - Move(wTarget); + else{ + if(Distance(L,wTarget)<5) + wander = false; + else + Move(wTarget); + } } void Creature::Move(Location l) -- cgit v1.2.3