aboutsummaryrefslogtreecommitdiff
path: root/Source/GameTick.cpp
diff options
context:
space:
mode:
authorrelnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-04-11 03:32:50 +0000
committerrelnev <relnev@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-04-11 03:32:50 +0000
commit4ea25dcd9390e6354707619ba455f1ca2b1131a1 (patch)
treed4ced2180253ba440af9021fabd4878159b98dc3 /Source/GameTick.cpp
parent3329a13ee8d26d4d13529a7b8c57277f9a6011d6 (diff)
downloadblackshades-4ea25dcd9390e6354707619ba455f1ca2b1131a1.tar.gz
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
Diffstat (limited to 'Source/GameTick.cpp')
-rw-r--r--Source/GameTick.cpp16
1 files changed, 10 insertions, 6 deletions
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;k<numpeople;k++){
-
+ // SBF - backing up the old coordinates makes
+ // the most sense here.
+ person[k].oldplayercoords=person[k].playercoords;
+
person[k].DoStuff(k);
if(person[k].skeleton.free<1){
@@ -1063,7 +1066,8 @@ void Game::Tick(){
}
- person[k].oldplayercoords=person[k].playercoords;
+ // SBF - this is definately in the wrong spot!
+ //person[k].oldplayercoords=person[k].playercoords;
}
@@ -1733,10 +1737,10 @@ void Game::Tick(){
// Realcheck tells us
// a) we've got close to the end of our path or
// b) we're moving away from our target
- // For whatever reason, part b) appears to be stuffed. Comment it out.
- 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){
+ 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;