mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fix UnitmotionFlying and implement CMessageMotionUpdate::FromJSVal
In 32e8ed51aa have been changed message from MotionChanged to
MotionUpdate and CMessageMotionUpdate::FromJSVal was not implemented to
reflect changes in message structure.
As a result UnitMotionFlying tries to send MotionChanged message which
not only was renamed, but sending it from js is not supported anymore.
Also reported at this thread:
https://wildfiregames.com/forum/index.php?/topic/27294-cheats-error/
Differential Revision: https://code.wildfiregames.com/D2450
Tested by: @gameboy
Tested on: Jenkins/vs2015, Jenkins/gcc6
Fixes: #5626
This was SVN commit r23208.
This commit is contained in:
@@ -281,9 +281,19 @@ JS::Value CMessageMotionUpdate::ToJSVal(const ScriptInterface& scriptInterface)
|
||||
return JS::ObjectValue(*obj);
|
||||
}
|
||||
|
||||
CMessage* CMessageMotionUpdate::FromJSVal(const ScriptInterface&, JS::HandleValue)
|
||||
CMessage* CMessageMotionUpdate::FromJSVal(const ScriptInterface& scriptInterface, JS::HandleValue val)
|
||||
{
|
||||
LOGWARNING("CMessageMotionUpdate::FromJSVal not implemented");
|
||||
FROMJSVAL_SETUP();
|
||||
GET_MSG_PROPERTY(std::wstring, updateString);
|
||||
|
||||
if (updateString == L"likelySuccess")
|
||||
return new CMessageMotionUpdate(CMessageMotionUpdate::LIKELY_SUCCESS);
|
||||
if (updateString == L"likelyFailure")
|
||||
return new CMessageMotionUpdate(CMessageMotionUpdate::LIKELY_FAILURE);
|
||||
if (updateString == L"obstructed")
|
||||
return new CMessageMotionUpdate(CMessageMotionUpdate::OBSTRUCTED);
|
||||
|
||||
LOGWARNING("CMessageMotionUpdate::FromJSVal passed wrong updateString");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user