1
0
forked from mirrors/0ad

Store whether a player is activ in C++

This prevents mods from mutating this value and revealing the map.

Part of this commit is written by @phosit.

(cherry picked from commit c9e76efe7b)
Signed-off-by: Itms <itms@wildfiregames.com>
This commit is contained in:
elexis
2024-12-30 12:14:34 +01:00
committed by Itms
parent 26d4c1550e
commit da87b72e6a
12 changed files with 187 additions and 39 deletions
@@ -1,4 +1,4 @@
/* Copyright (C) 2023 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -46,6 +46,13 @@ void CComponentTypeScript::Deinit()
ScriptFunction::CallVoid(rq, m_Instance, "Deinit");
}
bool CComponentTypeScript::HasMessageHandler(const CMessage& msg, const bool global)
{
const ScriptRequest rq(m_ScriptInterface);
return Script::HasProperty(rq, m_Instance, global ? msg.GetScriptGlobalHandlerName() :
msg.GetScriptHandlerName());
}
void CComponentTypeScript::HandleMessage(const CMessage& msg, bool global)
{
ScriptRequest rq(m_ScriptInterface);