if(vlen(self.origin - self.moveto) > 100)
{
- float do_run = !!(self.enemy);
+ float do_run = (self.enemy || self.monster_moveto);
if((self.flags & FL_ONGROUND) || ((self.flags & FL_FLY) || (self.flags & FL_SWIM)))
Monster_CalculateVelocity(self, self.moveto, self.origin, true, ((do_run) ? runspeed : walkspeed));
self.frags = FRAGS_PLAYER;
if(INDEPENDENT_PLAYERS)
MAKE_INDEPENDENT_PLAYER(self);
- self.flags = FL_CLIENT;
+ self.flags = FL_CLIENT | FL_PICKUPITEMS;
if(autocvar__notarget)
self.flags |= FL_NOTARGET;
self.takedamage = DAMAGE_AIM;
const int FL_TOSSED = 65536;
const int FL_NO_WEAPON_STAY = 131072;
const int FL_SPAWNING = 262144;
+const int FL_PICKUPITEMS = 524288;
const int SVC_SOUND = 6;
const int SVC_STOPSOUND = 16;
entity hook_pullentity;
float hook_velmultiplier;
MUTATOR_HOOKABLE(GrappleHookThink, EV_GrappleHookThink);
+
+#define EV_BuffModel_Customize(i, o) \
+ /**/ i(entity, self) \
+ /**/ i(entity, buff_player) \
+ /**/
+entity buff_player;
+MUTATOR_HOOKABLE(BuffModel_Customize, EV_BuffModel_Customize);
+
+/** called at when a buff is touched. Called early, can edit buff properties. */
+#define EV_BuffTouch(i, o) \
+ /** item */ i(entity, self) \
+ /** player */ i(entity, other) \
+ /**/
+MUTATOR_HOOKABLE(BuffTouch, EV_BuffTouch);
#endif
return BUFF_NULL;
}
-float buffs_BuffModel_Customize()
+bool buffs_BuffModel_Customize()
{
entity player, myowner;
- float same_team;
+ bool same_team;
player = WaypointSprite_getviewentity(other);
myowner = self.owner;
if(myowner.alpha <= 0.5 && !same_team && myowner.alpha != 0)
return false;
+ if(MUTATOR_CALLHOOK(BuffModel_Customize, self, player))
+ return false;
+
if(player == myowner || (IS_SPEC(other) && other.enemy == myowner))
{
// somewhat hide the model, but keep the glow
if((self.team && DIFF_TEAM(other, self))
|| (other.frozen)
|| (other.vehicle)
- || (!IS_PLAYER(other))
|| (!self.buff_active)
)
{
return;
}
+ if(MUTATOR_CALLHOOK(BuffTouch, self, other))
+ return;
+
+ if(!IS_PLAYER(other))
+ return; // incase mutator changed other
+
if (other.buffs)
{
if (other.cvar_cl_buffs_autoreplace && other.buffs != self.buffs)
}
}
- if (!IS_PLAYER(other))
- return;
- if (other.frozen)
- return;
- if (other.deadflag)
- return;
- if (self.solid != SOLID_TRIGGER)
- return;
- if (self.owner == other)
- return;
- if (time < self.item_spawnshieldtime)
- return;
+ if(!(other.flags & FL_PICKUPITEMS)
+ || other.frozen
+ || other.deadflag
+ || (self.solid != SOLID_TRIGGER)
+ || (self.owner == other)
+ || (time < self.item_spawnshieldtime)
+ ) { return;}
switch(MUTATOR_CALLHOOK(ItemTouch, self, other))
{