Do not use strstr()

This commit is contained in:
jeefo 2020-12-03 17:27:11 +03:00
commit 7da58623be
3 changed files with 5 additions and 5 deletions

View file

@ -214,7 +214,7 @@ bool BotSupport::isMonster (edict_t *ent) {
return false;
}
if (strncmp ("hostage", ent->v.classname.chars(), 7) == 0) {
if (strncmp ("hostage", ent->v.classname.chars (), 7) == 0) {
return false;
}
@ -222,7 +222,7 @@ bool BotSupport::isMonster (edict_t *ent) {
}
bool BotSupport::isItem (edict_t *ent) {
return !!(strstr (ent->v.classname.chars(), "item"));
return strncmp (ent->v.classname.chars (), "item", 4) == 0;
}
bool BotSupport::isPlayerVIP (edict_t *ent) {