mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-14 08:54:49 +00:00
GUIInterface / observermode cleanup as recommended by leper, fixes #3999.
Default to the viewed player in the GUIInterface to avoid passing that separately in some places, refs #3168. Thus GetEntityState will be called for the viewed player instead of observer playerID, therefore fixes a fog-of-war selection relict when changing the perspective, refs #3850. Also remove some unused player arguments. This was SVN commit r18283.
This commit is contained in:
@@ -123,13 +123,11 @@ JS::Value GuiInterfaceCall(ScriptInterface::CxPrivate* pCxPrivate, const std::ws
|
||||
if (!cmpGuiInterface)
|
||||
return JS::UndefinedValue();
|
||||
|
||||
int player = g_Game->GetPlayerID();
|
||||
|
||||
JSContext* cxSim = sim->GetScriptInterface().GetContext();
|
||||
JSAutoRequest rqSim(cxSim);
|
||||
JS::RootedValue arg(cxSim, sim->GetScriptInterface().CloneValueFromOtherContext(*(pCxPrivate->pScriptInterface), data));
|
||||
JS::RootedValue ret(cxSim);
|
||||
cmpGuiInterface->ScriptCall(player, name, arg, &ret);
|
||||
cmpGuiInterface->ScriptCall(g_Game->GetViewedPlayerID(), name, arg, &ret);
|
||||
|
||||
return pCxPrivate->pScriptInterface->CloneValueFromOtherContext(sim->GetScriptInterface(), ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user