e.monster_loot = self.monster_loot;
- other = e;
- MUTATOR_CALLHOOK(MonsterDropItem);
+ MUTATOR_CALLHOOK(MonsterDropItem, e);
e = other;
if(e && e.monster_loot)
{
other = ent;
if(ent.deadflag == DEAD_DEAD) // don't call when monster isn't dead
- if(MUTATOR_CALLHOOK(MonsterRespawn))
+ if(MUTATOR_CALLHOOK(MonsterRespawn, ent))
return true; // enabled by a mutator
if(ent.spawnflags & MONSTERFLAG_NORESPAWN)
{
float current_distance = vlen((('1 0 0' * to.x) + ('0 1 0' * to.y)) - (('1 0 0' * from.x) + ('0 1 0' * from.y))); // for the sake of this check, exclude Z axis
float initial_height = 0; //min(50, (targ_distance * tanh(20)));
- float current_height = (initial_height * min(1, (current_distance / self.pass_distance)));
+ float current_height = (initial_height * min(1, self.pass_distance ? (current_distance / self.pass_distance) : 0));
//print("current_height = ", ftos(current_height), ", initial_height = ", ftos(initial_height), ".\n");
vector targpos;
targ = self.goalentity;
- monster_target = targ;
- monster_speed_run = runspeed;
- monster_speed_walk = walkspeed;
-
- if(MUTATOR_CALLHOOK(MonsterMove) || gameover || self.draggedby != world || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < self.spawn_time)
+ if (MUTATOR_CALLHOOK(MonsterMove, runspeed, walkspeed, targ)
+ || gameover
+ || self.draggedby != world
+ || (round_handler_IsActive() && !round_handler_IsRoundStarted())
+ || time < game_starttime
+ || (autocvar_g_campaign && !campaign_bots_may_start)
+ || time < self.spawn_time)
{
runspeed = walkspeed = 0;
if(time >= self.spawn_time)
return;
}
- targ = monster_target;
runspeed = bound(0, monster_speed_run * Monster_SkillModifier(), runspeed * 2); // limit maxspeed to prevent craziness
walkspeed = bound(0, monster_speed_walk * Monster_SkillModifier(), walkspeed * 2); // limit maxspeed to prevent craziness
if(!mon)
return; // nothing to remove
- pointparticles(particleeffectnum("item_pickup"), mon.origin, '0 0 0', 1);
+ Send_Effect("item_pickup", mon.origin, '0 0 0', 1);
if(mon.weaponentity)
remove(mon.weaponentity);
WaypointSprite_Kill(self.sprite);
- frag_attacker = attacker;
frag_target = self;
- MUTATOR_CALLHOOK(MonsterDies);
+ MUTATOR_CALLHOOK(MonsterDies, attacker);
if(self.health <= -100 || deathtype == DEATH_KILL) // check if we're already gibbed
{