Fix incorrect event/return value for ScriptOrigin::GetAngleEvent
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build branch / build-all (push) Failing after 17s

This commit is contained in:
smallmodel 2024-12-12 23:50:42 +01:00
parent e15440af5e
commit 85da9fabdd
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -2126,7 +2126,8 @@ Event EV_ScriptOrigin_GetAngle
NULL,
"get the angles of the entity using just one value.\n"
"Gets the yaw of the entity or an up and down\n"
"direction if newAngle is [0-359] or -1 or -2"
"direction if newAngle is [0-359] or -1 or -2",
EV_GETTER
);
CLASS_DECLARATION(ScriptSlave, ScriptOrigin, "script_origin") {
@ -2173,7 +2174,10 @@ void ScriptOrigin::SetAngleEvent(Event* ev)
void ScriptOrigin::GetAngleEvent(Event* ev)
{
ev->AddFloat(G_GetAngle(angles));
Vector forward;
angles.AngleVectorsLeft(&forward);
ev->AddFloat(G_GetAngle(forward));
}
/*****************************************************************************/