Swap psTarget->pos and psViewer->pos back, so visibility and targetting rays are cast in the correct direction.

Visibility and targetting are no longer very weird.
master
Cyp 2010-03-05 23:56:15 +01:00
parent 7a1d9ead68
commit 478424e0b6
1 changed files with 2 additions and 2 deletions

View File

@ -393,7 +393,7 @@ int visibleObject(const BASE_OBJECT* psViewer, const BASE_OBJECT* psTarget, bool
return 0;
}
diff = Vector3i_Sub(psViewer->pos, psTarget->pos);
diff = Vector3i_Sub(psTarget->pos, psViewer->pos);
range = objSensorRange(psViewer);
/* Get the sensor Range and power */
@ -794,7 +794,7 @@ bool lineOfFire(const BASE_OBJECT* psViewer, const BASE_OBJECT* psTarget, bool w
return false;
}
diff = Vector3i_Sub(psViewer->pos, psTarget->pos);
diff = Vector3i_Sub(psTarget->pos, psViewer->pos);
range = objSensorRange(psViewer);
distSq = Vector3i_ScalarP(diff, diff);