From 4ea25dcd9390e6354707619ba455f1ca2b1131a1 Mon Sep 17 00:00:00 2001 From: relnev Date: Fri, 11 Apr 2003 03:32:50 +0000 Subject: Moved the copy from position to oldposition to a better spot. It helps to backup position before updating it. Also uncommented the distance check now that it works. Thanks to Toby Haynes for finding where the pathfinding broke down. git-svn-id: svn://svn.icculus.org/blackshades/trunk@99 5198baeb-e213-0410-be47-fc2ff85ca46f --- Source/GameTick.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'Source/GameTick.cpp') diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 4bce571..ce597df 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -870,7 +870,10 @@ void Game::Tick(){ //Check people collisions for(int k=0;kfindDistancefast(person[i].oldplayercoords,person[i].pathtarget) - if(person[i].targetanimation==idleanim&&person[i].killtargetvisible==0){ + realcheck=(abs(person[i].playercoords.x-person[i].pathtarget.x)<1&&abs(person[i].playercoords.z-person[i].pathtarget.z)<1) + ||findDistancefast(person[i].playercoords,person[i].pathtarget)>findDistancefast(person[i].oldplayercoords,person[i].pathtarget); + + if(person[i].targetanimation==idleanim&&person[i].killtargetvisible==0){ person[i].targetanimation=walkanim; -- cgit v1.2.3