diff --git a/src/Components/Modules/Bots.cpp b/src/Components/Modules/Bots.cpp index 354c33bc..e9e01f8e 100644 --- a/src/Components/Modules/Bots.cpp +++ b/src/Components/Modules/Bots.cpp @@ -126,8 +126,8 @@ namespace Components return; } - const auto* gentity = Script::GetEntFromEntRef(entref); - auto* client = Script::GetClientFromEnt(gentity); + const auto* gentity = Script::GetEntity(entref); + auto* client = Script::GetClient(gentity); if (!client->bIsTestClient) { @@ -138,18 +138,18 @@ namespace Components client->ping = static_cast(ping); }); - Script::AddFunction("IsBot", [](Game::scr_entref_t entref) // Usage: IsBot(); + Script::AddFunction("IsTestClient", [](Game::scr_entref_t entref) // Usage: IsTestClient(); { - const auto* gentity = Script::GetEntFromEntRef(entref); - const auto* client = Script::GetClientFromEnt(gentity); + const auto* gentity = Script::GetEntity(entref); + const auto* client = Script::GetClient(gentity); Game::Scr_AddBool(client->bIsTestClient == 1); }); Script::AddFunction("BotStop", [](Game::scr_entref_t entref) // Usage: BotStop(); { - const auto* gentity = Script::GetEntFromEntRef(entref); - const auto* client = Script::GetClientFromEnt(gentity); + const auto* gentity = Script::GetEntity(entref); + const auto* client = Script::GetClient(gentity); if (!client->bIsTestClient) { @@ -165,8 +165,8 @@ namespace Components { const auto* weapon = Game::Scr_GetString(0); - const auto* gentity = Script::GetEntFromEntRef(entref); - const auto* client = Script::GetClientFromEnt(gentity); + const auto* gentity = Script::GetEntity(entref); + const auto* client = Script::GetClient(gentity); if (!client->bIsTestClient) { @@ -194,8 +194,8 @@ namespace Components return; } - const auto* gentity = Script::GetEntFromEntRef(entref); - const auto* client = Script::GetClientFromEnt(gentity); + const auto* gentity = Script::GetEntity(entref); + const auto* client = Script::GetClient(gentity); if (!client->bIsTestClient) { @@ -230,8 +230,8 @@ namespace Components auto forwardInt = Game::Scr_GetInt(0); auto rightInt = Game::Scr_GetInt(1); - const auto* gentity = Script::GetEntFromEntRef(entref); - const auto* client = Script::GetClientFromEnt(gentity); + const auto* gentity = Script::GetEntity(entref); + const auto* client = Script::GetClient(gentity); if (!client->bIsTestClient) { diff --git a/src/Components/Modules/ClientCommand.cpp b/src/Components/Modules/ClientCommand.cpp index 4f1075be..d079cb5c 100644 --- a/src/Components/Modules/ClientCommand.cpp +++ b/src/Components/Modules/ClientCommand.cpp @@ -142,7 +142,7 @@ namespace Components { Script::AddFunction("Noclip", [](Game::scr_entref_t entref) // gsc: Noclip(); { - const auto* ent = Script::GetEntFromEntRef(entref); + const auto* ent = Script::GetEntity(entref); if (ent->client == nullptr) { @@ -169,7 +169,7 @@ namespace Components Script::AddFunction("Ufo", [](Game::scr_entref_t entref) // gsc: Ufo(); { - const auto* ent = Script::GetEntFromEntRef(entref); + const auto* ent = Script::GetEntity(entref); if (ent->client == nullptr) { @@ -196,7 +196,7 @@ namespace Components Script::AddFunction("God", [](Game::scr_entref_t entref) // gsc: God(); { - auto* ent = Script::GetEntFromEntRef(entref); + auto* ent = Script::GetEntity(entref); if (Game::Scr_GetNumParam() >= 1u) { @@ -217,7 +217,7 @@ namespace Components Script::AddFunction("Demigod", [](Game::scr_entref_t entref) // gsc: Demigod(); { - auto* ent = Script::GetEntFromEntRef(entref); + auto* ent = Script::GetEntity(entref); if (Game::Scr_GetNumParam() >= 1u) { @@ -238,7 +238,7 @@ namespace Components Script::AddFunction("Notarget", [](Game::scr_entref_t entref) // gsc: Notarget(); { - auto* ent = Script::GetEntFromEntRef(entref); + auto* ent = Script::GetEntity(entref); if (Game::Scr_GetNumParam() >= 1u) { diff --git a/src/Components/Modules/Script.cpp b/src/Components/Modules/Script.cpp index b2cb91fc..11001fee 100644 --- a/src/Components/Modules/Script.cpp +++ b/src/Components/Modules/Script.cpp @@ -521,7 +521,7 @@ namespace Components } } - Game::gentity_t* Script::GetEntFromEntRef(const Game::scr_entref_t entref) + Game::gentity_t* Script::GetEntity(const Game::scr_entref_t entref) { if (entref.classnum != 0 || entref.entnum >= Game::MAX_GENTITIES) { @@ -532,7 +532,7 @@ namespace Components return &Game::g_entities[entref.entnum]; } - Game::client_t* Script::GetClientFromEnt(const Game::gentity_t* gentity) + Game::client_t* Script::GetClient(const Game::gentity_t* gentity) { if (gentity->client == nullptr) { @@ -663,7 +663,7 @@ namespace Components // PlayerCmd_AreControlsFrozen GSC function from Black Ops 2 Script::AddFunction("AreControlsFrozen", [](Game::scr_entref_t entref) // Usage: self AreControlsFrozen(); { - const auto* ent = Script::GetEntFromEntRef(entref); + const auto* ent = Script::GetEntity(entref); if (ent->client == nullptr) { diff --git a/src/Components/Modules/Script.hpp b/src/Components/Modules/Script.hpp index ce514a37..c1de5331 100644 --- a/src/Components/Modules/Script.hpp +++ b/src/Components/Modules/Script.hpp @@ -29,8 +29,8 @@ namespace Components static void OnVMShutdown(Utils::Slot callback); - static Game::gentity_t* GetEntFromEntRef(const Game::scr_entref_t entref); - static Game::client_t* GetClientFromEnt(const Game::gentity_t* gentity); + static Game::gentity_t* GetEntity(const Game::scr_entref_t entref); + static Game::client_t* GetClient(const Game::gentity_t* gentity); private: static std::string ScriptName;