mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fix 3872ee43b5 and 768c84aa46
Tested by: @Langbart Fixes: #5934 Differential Revision: https://code.wildfiregames.com/D3409 This was SVN commit r24682.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "soundmanager/ISoundManager.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <unordered_map>
|
||||
|
||||
const CStr IGUIObject::EventNameMouseEnter = "MouseEnter";
|
||||
@@ -349,7 +350,8 @@ void IGUIObject::SetScriptHandler(const CStr& eventName, JS::HandleObject Functi
|
||||
|
||||
m_ScriptHandlers[eventName] = JS::Heap<JSObject*>(Function);
|
||||
|
||||
m_pGUI.m_EventObjects[eventName].push_back(this);
|
||||
if (std::find(m_pGUI.m_EventObjects[eventName].begin(), m_pGUI.m_EventObjects[eventName].end(), this) == m_pGUI.m_EventObjects[eventName].end())
|
||||
m_pGUI.m_EventObjects[eventName].emplace_back(this);
|
||||
}
|
||||
|
||||
void IGUIObject::UnsetScriptHandler(const CStr& eventName)
|
||||
|
||||
Reference in New Issue
Block a user