.void(entity) monster_delayedfunc;
void Monster_Delay_Action(entity this)
{
- if(Monster_ValidTarget(this.owner, this.owner.enemy)) { this.monster_delayedfunc(this.owner); }
+ if(Monster_ValidTarget(this.owner, this.owner.enemy))
+ {
+ monster_makevectors(this.owner, this.owner.enemy);
+ this.monster_delayedfunc(this.owner);
+ }
if(this.cnt > 1)
{
else
this.attack_finished_single[0] = this.anim_finished = time + animtime;
- monster_makevectors(this, targ);
-
traceline(this.origin + this.view_ofs, this.origin + v_forward * er, 0, this);
if(trace_ent.takedamage)
if(vdist(targ.origin - this.origin, <=, this.attack_range))
{
+ monster_makevectors(this, targ);
int attack_success = this.monster_attackfunc(MONSTER_ATTACK_MELEE, this, targ, weaponentity);
if(attack_success == 1)
Monster_Sound(this, monstersound_melee, 0, false, CH_VOICE);
if(vdist(targ.origin - this.origin, >, this.attack_range))
{
+ monster_makevectors(this, targ);
int attack_success = this.monster_attackfunc(MONSTER_ATTACK_RANGED, this, targ, weaponentity);
if(attack_success == 1)
Monster_Sound(this, monstersound_melee, 0, false, CH_VOICE);
if(trace_ent && IS_MONSTER(trace_ent))
reverse = true;
- // TODO: fix this... tracing is broken if the floor is thin
- /*
- if(!allow_jumpoff)
+ if(!allow_jumpoff && IS_ONGROUND(this))
{
- a = b - '0 0 32';
- traceline(b, a, MOVE_WORLDONLY, this);
+ traceline(b, b - '0 0 32', MOVE_NORMAL, this);
if(trace_fraction == 1.0)
reverse = true;
- } */
+ }
if(reverse)
{
if(!autocvar_g_monsters) { Monster_Remove(this); return false; }
- if(!(this.spawnflags & MONSTERFLAG_RESPAWNED))
+ if(!(this.spawnflags & MONSTERFLAG_RESPAWNED) && !(this.flags & FL_MONSTER))
{
IL_PUSH(g_monsters, this);
if(this.mdl && this.mdl != "")