Fixed the return value of TurnActorTo.

It must return true if the target yaw is different from the actual yaw of
the actor, and false otherwise.
This commit is contained in:
Giulio Camuffo 2011-03-31 18:56:20 +02:00
parent d4454dc2ce
commit ce356f9d4b

View File

@ -1467,10 +1467,15 @@ static void TurnActorTo() {
float yaw = lookVector.unitCircleAngle();
// yaw is offset from forward by 90 degrees
yaw -= 90.0f;
if (yaw < 0) {
yaw += 360.f;
}
actor->turnTo(0, yaw, 0);
// Game will lock in elevator if this doesn't return false
pushbool(false);
float diff = actor->yaw() - yaw;
// Return true if the actor is still turning and its yaw is not the target one.
// This allows manny to have the right yaw when he exits the elevator in the garage
pushbool((diff > 0.005) || (diff < -0.005)); //fuzzy compare
}
static void PointActorAt() {