NSMonster: Add MSF_HORDE flag. That marks a monster as constantly being aware and finding the nearest player for attack.
This commit is contained in:
parent
643211efae
commit
50070b031b
2 changed files with 11 additions and 1 deletions
|
@ -117,7 +117,8 @@ typedef enumflags
|
||||||
MSF_PREDISASTER,
|
MSF_PREDISASTER,
|
||||||
MSF_FADECORPSE,
|
MSF_FADECORPSE,
|
||||||
MSF_MULTIPLAYER,
|
MSF_MULTIPLAYER,
|
||||||
MSF_FALLING
|
MSF_FALLING,
|
||||||
|
MSF_HORDE
|
||||||
} monsterFlag_t;
|
} monsterFlag_t;
|
||||||
|
|
||||||
/* movement states */
|
/* movement states */
|
||||||
|
|
|
@ -180,6 +180,15 @@ NSMonster::SeeThink(void)
|
||||||
|
|
||||||
m_flSeeTime = time + 0.25f;
|
m_flSeeTime = time + 0.25f;
|
||||||
|
|
||||||
|
/* a horse type monster always knows where the nearest player is */
|
||||||
|
if (m_iFlags & MSF_HORDE) {
|
||||||
|
m_eEnemy = Entity_FindClosest(this, "player");
|
||||||
|
|
||||||
|
if (m_eEnemy)
|
||||||
|
NewRoute(m_eEnemy.origin);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (entity w = world; (w = findfloat(w, ::takedamage, DAMAGE_YES));) {
|
for (entity w = world; (w = findfloat(w, ::takedamage, DAMAGE_YES));) {
|
||||||
/* prevent them from shooting non-sentient stuff */
|
/* prevent them from shooting non-sentient stuff */
|
||||||
if (!(w.flags & FL_MONSTER) && !(w.flags & FL_CLIENT))
|
if (!(w.flags & FL_MONSTER) && !(w.flags & FL_CLIENT))
|
||||||
|
|
Loading…
Reference in a new issue