Add script function from bo2 for good mesure

This commit is contained in:
FutureRave 2022-01-14 00:21:14 +00:00
parent 52d2a101e6
commit 3b52208c87
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955

View File

@ -643,6 +643,22 @@ namespace Components
Script::ScriptStorage.clear(); Script::ScriptStorage.clear();
}); });
Script::AddFunction("AreControlsFrozen", [](Game::scr_entref_t entref) // Usage: self AreControlsFrozen();
{
auto* ent = Script::GetEntFromEntRef(entref);
if (ent->client == nullptr)
{
Game::Scr_ObjectError(Utils::String::VA("Entity %u is not a player", entref));
return;
}
const auto isToggled = (ent->client->flags & Game::PLAYER_FLAG_FROZEN)
? 1 : 0;
Game::Scr_AddInt(isToggled);
});
Script::AddFunction("DebugCode", [](Game::scr_entref_t) // gsc: DebugCode(<int toggle>) Script::AddFunction("DebugCode", [](Game::scr_entref_t) // gsc: DebugCode(<int toggle>)
{ {
if (Game::Scr_GetNumParam() != 1u) if (Game::Scr_GetNumParam() != 1u)