mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-23 13:12:55 +00:00
Pass ScriptRequest instead of ScriptInterface in simulation messages.
The previous code was constructing un-necessary ScriptRequest objects. Minor optimisation from not entering/leaving realms. Differential Revision: https://code.wildfiregames.com/D5026 This was SVN commit r27728.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2021 Wildfire Games.
|
||||
/* Copyright (C) 2023 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -52,7 +52,7 @@ void CComponentTypeScript::HandleMessage(const CMessage& msg, bool global)
|
||||
|
||||
const char* name = global ? msg.GetScriptGlobalHandlerName() : msg.GetScriptHandlerName();
|
||||
|
||||
JS::RootedValue msgVal(rq.cx, msg.ToJSValCached(m_ScriptInterface));
|
||||
JS::RootedValue msgVal(rq.cx, msg.ToJSValCached(rq));
|
||||
|
||||
if (!ScriptFunction::CallVoid(rq, m_Instance, name, msgVal))
|
||||
LOGERROR("Script message handler %s failed", name);
|
||||
|
||||
Reference in New Issue
Block a user