From d6b614af8e61376f7604b05489ad65f825dd9007 Mon Sep 17 00:00:00 2001 From: mohabhassan Date: Thu, 13 Apr 2023 00:36:13 +0200 Subject: [PATCH] Add missing MOHAA trigonometric math script functions #17 --- dgamexwrapper/src/ScriptThreadMaths.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/dgamexwrapper/src/ScriptThreadMaths.cpp b/dgamexwrapper/src/ScriptThreadMaths.cpp index ce698a6..0fba1c8 100644 --- a/dgamexwrapper/src/ScriptThreadMaths.cpp +++ b/dgamexwrapper/src/ScriptThreadMaths.cpp @@ -2,6 +2,7 @@ void ScriptThread::MathsInit() { +#ifdef MOHAA cerSet.AddEventResponse(new Event( "sin", EV_DEFAULT, @@ -21,7 +22,6 @@ void ScriptThread::MathsInit() EV_RETURN ), &ScriptThread::MCosEvent); - cerSet.AddEventResponse(new Event( "tan", EV_DEFAULT, @@ -33,34 +33,36 @@ void ScriptThread::MathsInit() &ScriptThread::MTanEvent); cerSet.AddEventResponse(new Event( - "asin", + "atan", EV_DEFAULT, "f", "x", - "Returns the arc sine of an angle of x radians.", + "Returns the arc tangent of an angle of x radians. Use atan2 instead.", EV_RETURN ), - &ScriptThread::MASinEvent); + &ScriptThread::MATanEvent); +#endif cerSet.AddEventResponse(new Event( - "acos", + "asin", EV_DEFAULT, "f", "x", - "Returns the arc cosine of an angle of x radians.", + "Returns the arc sine of an angle of x radians.", EV_RETURN ), - &ScriptThread::MACosEvent); + &ScriptThread::MASinEvent); cerSet.AddEventResponse(new Event( - "atan", + "acos", EV_DEFAULT, "f", "x", - "Returns the arc tangent of an angle of x radians. Use atan2 instead.", + "Returns the arc cosine of an angle of x radians.", EV_RETURN ), - &ScriptThread::MATanEvent); + &ScriptThread::MACosEvent); + cerSet.AddEventResponse(new Event( "atan2",