Added custom monsters and custom items support

This commit is contained in:
Hedgehog Fog 2020-12-03 14:14:22 +02:00
commit d5107daad4
7 changed files with 82 additions and 6 deletions

View file

@ -205,6 +205,26 @@ bool BotSupport::isPlayer (edict_t *ent) {
return false;
}
bool BotSupport::isMonster (edict_t *ent) {
if (game.isNullEntity (ent)) {
return false;
}
if (~ent->v.flags & FL_MONSTER) {
return false;
}
if (strncmp ("hostage", ent->v.classname.chars(), 7) == 0) {
return false;
}
return true;
}
bool BotSupport::isItem (edict_t *ent) {
return !!(strstr (ent->v.classname.chars(), "item"));
}
bool BotSupport::isPlayerVIP (edict_t *ent) {
if (!game.mapIs (MapFlags::Assassination)) {
return false;