if(e && e.monster_loot)
{
e.noalign = true;
- WITH(entity, self, e, e.monster_loot(e));
+ WITHSELF(e, e.monster_loot(e));
e.gravity = 1;
e.movetype = MOVETYPE_TOSS;
e.reset = SUB_Remove;
|| (!IS_VEHICLE(targ) && (IS_DEAD(targ) || IS_DEAD(this) || targ.health <= 0 || this.health <= 0))
|| (this.monster_follow == targ || targ.monster_follow == this)
|| (!IS_VEHICLE(targ) && (targ.flags & FL_NOTARGET))
- || (!autocvar_g_monsters_typefrag && targ.BUTTON_CHAT)
+ || (!autocvar_g_monsters_typefrag && PHYS_INPUT_BUTTON_CHAT(targ))
|| (SAME_TEAM(targ, this))
|| (STAT(FROZEN, targ))
|| (targ.alpha != 0 && targ.alpha < 0.5)
void Monster_Delay_Action_self()
{
+ SELFPARAM();
Monster_Delay_Action(self);
}
}
}
-void Monster_Use()
-{SELFPARAM();
- if(Monster_ValidTarget(this, activator)) { this.enemy = activator; }
+void Monster_Use(entity this, entity actor, entity trigger)
+{
+ if(Monster_ValidTarget(this, actor)) { this.enemy = actor; }
}
vector Monster_Move_Target(entity this, entity targ)
void Monster_Remove(entity this)
{
+ if(IS_CLIENT(this))
+ return; // don't remove it?
+
.entity weaponentity = weaponentities[0];
if(!this) { return; }
}
}
-void Monster_Appear()
-{SELFPARAM();
- this.enemy = activator;
+void Monster_Appear(entity this, entity actor, entity trigger)
+{
+ this.enemy = actor;
this.spawnflags &= ~MONSTERFLAG_APPEAR; // otherwise, we get an endless loop
Monster_Spawn(this, this.monsterid);
}
this.candrop = false; // killed by mobkill command
// TODO: fix this?
- activator = attacker;
- other = this.enemy;
- WITH(entity, self, this, SUB_UseTargets());
+ SUB_UseTargets(this, attacker, this.enemy);
this.target2 = this.oldtarget2; // reset to original target on death, incase we respawn
Monster_Dead(this, attacker, (this.health <= -100 || deathtype == DEATH_KILL.m_id));
if(autocvar_g_nodepthtestplayers) { this.effects |= EF_NODEPTHTEST; }
if(mon.spawnflags & MONSTER_TYPE_SWIM) { this.flags |= FL_SWIM; }
+ if(autocvar_g_playerclip_collisions)
+ this.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
+
if(mon.spawnflags & MONSTER_TYPE_FLY)
{
this.flags |= FL_FLY;