- fixed: ACS's GetActorPitch needs to convert to a signed angle.

This commit is contained in:
Christoph Oelckers 2016-04-09 21:44:09 +02:00
parent daa112e2ac
commit bcebeadedc

View file

@ -178,6 +178,11 @@ inline int AngleToACS(DAngle ang)
return ang.BAMs() >> 16; return ang.BAMs() >> 16;
} }
inline int PitchToACS(DAngle ang)
{
return int(ang.Normalized180().Degrees * (65536. / 360));
}
struct CallReturn struct CallReturn
{ {
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, ACSLocalArrays *arrays, bool discard, unsigned int runaway) CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, ACSLocalArrays *arrays, bool discard, unsigned int runaway)
@ -8751,7 +8756,7 @@ scriptwait:
case PCD_GETACTORPITCH: case PCD_GETACTORPITCH:
{ {
AActor *actor = SingleActorFromTID(STACK(1), activator); AActor *actor = SingleActorFromTID(STACK(1), activator);
STACK(1) = actor == NULL ? 0 : AngleToACS(actor->Angles.Pitch); STACK(1) = actor == NULL ? 0 : PitchToACS(actor->Angles.Pitch);
} }
break; break;