Fix weapon check

This commit is contained in:
FutureRave 2022-01-24 02:08:28 +00:00
parent d7a2b1aae7
commit 4c8198e687
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955

View File

@ -166,12 +166,6 @@ namespace Components
{ {
const auto* weapon = Game::Scr_GetString(0); const auto* weapon = Game::Scr_GetString(0);
if (weapon == nullptr)
{
Game::Scr_ParamError(0, "^1BotWeapon: Illegal parameter!\n");
return;
}
const auto* gentity = Script::GetEntFromEntRef(entref); const auto* gentity = Script::GetEntFromEntRef(entref);
const auto* client = Script::GetClientFromEnt(gentity); const auto* client = Script::GetClientFromEnt(gentity);
@ -181,7 +175,7 @@ namespace Components
return; return;
} }
if (weapon[0] == '\0') if (weapon == nullptr || weapon[0] == '\0')
{ {
g_botai[entref.entnum].weapon = 1; g_botai[entref.entnum].weapon = 1;
return; return;