[GSC]: Remove reduntant color code (#830)

This commit is contained in:
Edo 2023-03-12 11:40:01 +00:00 committed by GitHub
parent e0f7d42022
commit 09ff8b4fb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 31 deletions

View File

@ -213,7 +213,7 @@ namespace Components
if (Game::SV_IsTestClient(ent->s.number) == 0) if (Game::SV_IsTestClient(ent->s.number) == 0)
{ {
Game::Scr_Error("^1BotStop: Can only call on a bot!"); Game::Scr_Error("BotStop: Can only call on a bot!");
return; return;
} }
@ -228,7 +228,7 @@ namespace Components
if (Game::SV_IsTestClient(ent->s.number) == 0) if (Game::SV_IsTestClient(ent->s.number) == 0)
{ {
Game::Scr_Error("^1BotWeapon: Can only call on a bot!"); Game::Scr_Error("BotWeapon: Can only call on a bot!");
return; return;
} }
@ -251,7 +251,7 @@ namespace Components
if (Game::SV_IsTestClient(ent->s.number) == 0) if (Game::SV_IsTestClient(ent->s.number) == 0)
{ {
Game::Scr_Error("^1BotAction: Can only call on a bot!"); Game::Scr_Error("BotAction: Can only call on a bot!");
return; return;
} }
@ -259,13 +259,13 @@ namespace Components
if (!action) if (!action)
{ {
Game::Scr_ParamError(0, "^1BotAction: Illegal parameter!"); Game::Scr_ParamError(0, "BotAction: Illegal parameter!");
return; return;
} }
if (action[0] != '+' && action[0] != '-') if (action[0] != '+' && action[0] != '-')
{ {
Game::Scr_ParamError(0, "^1BotAction: Sign for action must be '+' or '-'"); Game::Scr_ParamError(0, "BotAction: Sign for action must be '+' or '-'");
return; return;
} }
@ -283,7 +283,7 @@ namespace Components
return; return;
} }
Game::Scr_ParamError(0, "^1BotAction: Unknown action"); Game::Scr_ParamError(0, "BotAction: Unknown action");
}); });
GSC::Script::AddMethod("BotMovement", [](Game::scr_entref_t entref) // Usage: <bot> BotMovement(<int>, <int>); GSC::Script::AddMethod("BotMovement", [](Game::scr_entref_t entref) // Usage: <bot> BotMovement(<int>, <int>);
@ -292,7 +292,7 @@ namespace Components
if (Game::SV_IsTestClient(ent->s.number) == 0) if (Game::SV_IsTestClient(ent->s.number) == 0)
{ {
Game::Scr_Error("^1BotMovement: Can only call on a bot!"); Game::Scr_Error("BotMovement: Can only call on a bot!");
return; return;
} }

View File

@ -590,13 +590,13 @@ namespace Components
{ {
if (Game::Scr_GetNumParam() != 1) if (Game::Scr_GetNumParam() != 1)
{ {
Game::Scr_Error("^1OnPlayerSay: Needs one function pointer!"); Game::Scr_Error("OnPlayerSay: Needs one function pointer!");
return; return;
} }
if (!CanAddCallback) if (!CanAddCallback)
{ {
Game::Scr_Error("^1OnPlayerSay: Cannot add a callback in this context"); Game::Scr_Error("OnPlayerSay: Cannot add a callback in this context");
return; return;
} }

View File

@ -16,13 +16,13 @@ namespace Components::GSC
if (!path) if (!path)
{ {
Game::Scr_ParamError(0, "^1FileWrite: filepath is not defined!"); Game::Scr_ParamError(0, "FileWrite: filepath is not defined!");
return; return;
} }
if (!text || !mode) if (!text || !mode)
{ {
Game::Scr_Error("^1FileWrite: Illegal parameters!"); Game::Scr_Error("FileWrite: Illegal parameters!");
return; return;
} }
@ -59,7 +59,7 @@ namespace Components::GSC
if (!path) if (!path)
{ {
Game::Scr_ParamError(0, "^1FileRead: filepath is not defined!"); Game::Scr_ParamError(0, "FileRead: filepath is not defined!");
return; return;
} }
@ -92,7 +92,7 @@ namespace Components::GSC
if (!path) if (!path)
{ {
Game::Scr_ParamError(0, "^1FileExists: filepath is not defined!"); Game::Scr_ParamError(0, "FileExists: filepath is not defined!");
return; return;
} }
@ -115,7 +115,7 @@ namespace Components::GSC
if (!path) if (!path)
{ {
Game::Scr_ParamError(0, "^1FileRemove: filepath is not defined!"); Game::Scr_ParamError(0, "FileRemove: filepath is not defined!");
return; return;
} }
@ -123,7 +123,7 @@ namespace Components::GSC
{ {
if (std::strstr(path, QueryStrings[i]) != nullptr) if (std::strstr(path, QueryStrings[i]) != nullptr)
{ {
Logger::Print("^1FileRemove: directory traversal is not allowed!\n"); Logger::Print("FileRemove: directory traversal is not allowed!\n");
return; return;
} }
} }

View File

@ -113,7 +113,7 @@ namespace Components::GSC
{ {
if (static_cast<unsigned int>(index) >= Game::scrVmPub->outparamcount) if (static_cast<unsigned int>(index) >= Game::scrVmPub->outparamcount)
{ {
Game::Scr_ParamError(static_cast<unsigned int>(index), "^1GetCodePosForParam: Index is out of range!"); Game::Scr_ParamError(static_cast<unsigned int>(index), "GetCodePosForParam: Index is out of range!");
return ""; return "";
} }
@ -121,7 +121,7 @@ namespace Components::GSC
if (value->type != Game::VAR_FUNCTION) if (value->type != Game::VAR_FUNCTION)
{ {
Game::Scr_ParamError(static_cast<unsigned int>(index), "^1GetCodePosForParam: Expects a function as parameter!"); Game::Scr_ParamError(static_cast<unsigned int>(index), "GetCodePosForParam: Expects a function as parameter!");
return ""; return "";
} }
@ -223,7 +223,7 @@ namespace Components::GSC
{ {
if (Game::Scr_GetNumParam() != 2) if (Game::Scr_GetNumParam() != 2)
{ {
Game::Scr_Error("^1ReplaceFunc: Needs two parameters!"); Game::Scr_Error("ReplaceFunc: Needs two parameters!");
return; return;
} }
@ -247,7 +247,7 @@ namespace Components::GSC
const auto* str = Game::Scr_GetString(0); const auto* str = Game::Scr_GetString(0);
if (!str) if (!str)
{ {
Game::Scr_ParamError(0, "^1Exec: Illegal parameter!"); Game::Scr_ParamError(0, "Exec: Illegal parameter!");
return; return;
} }
@ -262,7 +262,7 @@ namespace Components::GSC
const auto* str = Game::Scr_GetString(i); const auto* str = Game::Scr_GetString(i);
if (!str) if (!str)
{ {
Game::Scr_ParamError(i, "^1PrintConsole: Illegal parameter!"); Game::Scr_ParamError(i, "PrintConsole: Illegal parameter!");
return; return;
} }

View File

@ -16,7 +16,7 @@ namespace Components::GSC
if (!key || !value) if (!key || !value)
{ {
Game::Scr_Error("^1StorageSet: Illegal parameters!"); Game::Scr_Error("StorageSet: Illegal parameters!");
return; return;
} }
@ -29,13 +29,13 @@ namespace Components::GSC
if (!key) if (!key)
{ {
Game::Scr_ParamError(0, "^1StorageRemove: Illegal parameter!"); Game::Scr_ParamError(0, "StorageRemove: Illegal parameter!");
return; return;
} }
if (!Data.contains(key)) if (!Data.contains(key))
{ {
Game::Scr_Error(Utils::String::VA("^1StorageRemove: Store does not have key '%s'!", key)); Game::Scr_Error(Utils::String::VA("StorageRemove: Store does not have key '%s'!", key));
return; return;
} }
@ -48,13 +48,13 @@ namespace Components::GSC
if (!key) if (!key)
{ {
Game::Scr_ParamError(0, "^1StorageGet: Illegal parameter!"); Game::Scr_ParamError(0, "StorageGet: Illegal parameter!");
return; return;
} }
if (!Data.contains(key)) if (!Data.contains(key))
{ {
Game::Scr_Error(Utils::String::VA("^1StorageGet: Store does not have key '%s'!", key)); Game::Scr_Error(Utils::String::VA("StorageGet: Store does not have key '%s'!", key));
} }
const auto& data = Data.at(key); const auto& data = Data.at(key);
@ -67,7 +67,7 @@ namespace Components::GSC
if (!key) if (!key)
{ {
Game::Scr_ParamError(0, "^1StorageHas: Illegal parameter!"); Game::Scr_ParamError(0, "StorageHas: Illegal parameter!");
return; return;
} }
@ -78,7 +78,7 @@ namespace Components::GSC
{ {
if (Data.empty()) if (Data.empty())
{ {
Game::Scr_Error("^1StorageDump: ScriptStorage is empty!"); Game::Scr_Error("StorageDump: ScriptStorage is empty!");
return; return;
} }

View File

@ -58,7 +58,7 @@ namespace Components::GSC
if (!str) if (!str)
{ {
Game::Scr_Error("^1GetChar: Illegal parameter!"); Game::Scr_Error("GetChar: Illegal parameter!");
return; return;
} }
@ -89,7 +89,7 @@ namespace Components::GSC
if (!str || !suffix) if (!str || !suffix)
{ {
Game::Scr_Error("^1IsEndStr: Illegal parameters!"); Game::Scr_Error("IsEndStr: Illegal parameters!");
return; return;
} }

View File

@ -54,7 +54,7 @@ namespace Components::GSC
if (!name) if (!name)
{ {
Game::Scr_ParamError(0, "^1SetName: Illegal parameter!"); Game::Scr_ParamError(0, "SetName: Illegal parameter!");
return; return;
} }
@ -79,7 +79,7 @@ namespace Components::GSC
if (!clanName) if (!clanName)
{ {
Game::Scr_ParamError(0, "^1SetClanTag: Illegal parameter!"); Game::Scr_ParamError(0, "SetClanTag: Illegal parameter!");
return; return;
} }