if (s == WP_Item.netname || s == RADARICON_Item.netname) return Items_from(this.wp_extra).m_color;
if (MUTATOR_CALLHOOK(WP_Format, this, s))
{
- return MUTATOR_ARGV(0, vector);
+ return M_ARGV(2, vector);
}
return def;
}
if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).monster_name;
if (MUTATOR_CALLHOOK(WP_Format, this, s))
{
- return MUTATOR_ARGV(0, string);
+ return M_ARGV(3, string);
}
// need to loop, as our netname could be one of three
}
}
-void WaypointSprite_Think()
-{SELFPARAM();
+void WaypointSprite_Think(entity this)
+{
bool doremove = false;
if (self.fade_time && time >= self.teleport_time)
return e2 == e;
}
-float WaypointSprite_Customize()
-{SELFPARAM();
+float WaypointSprite_Customize(entity this)
+{
// this is not in SendEntity because it shall run every frame, not just every update
// make spectators see what the player would see
bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
-void WaypointSprite_Reset()
-{SELFPARAM();
+void WaypointSprite_Reset(entity this)
+{
// if a WP wants to time out, let it time out immediately; other WPs ought to be reset/killed by their owners
- if (self.fade_time)
- WaypointSprite_Kill(self);
+ if (this.fade_time)
+ WaypointSprite_Kill(this);
}
entity WaypointSprite_Spawn(
wp.owned_by_field = ownfield;
}
wp.fade_rate = maxdistance;
- wp.think = WaypointSprite_Think;
+ setthink(wp, WaypointSprite_Think);
wp.nextthink = time;
wp.model1 = spr.netname;
- wp.customizeentityforclient = WaypointSprite_Customize;
+ setcefc(wp, WaypointSprite_Customize);
wp.waypointsprite_visible_for_player = WaypointSprite_visible_for_player;
wp.reset2 = WaypointSprite_Reset;
wp.cnt = icon.m_id;
entity WaypointSprite_DeployFixed(
entity spr,
float limited_range,
+ entity player,
vector ofs,
entity icon // initial icon
)
-{SELFPARAM();
+{
float t;
if (teamplay)
- t = self.team;
+ t = player.team;
else
t = 0;
float maxdistance;
maxdistance = waypointsprite_limitedrange;
else
maxdistance = 0;
- return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, self, waypointsprite_deployed_fixed, false, icon);
+ return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, player, waypointsprite_deployed_fixed, false, icon);
}
entity WaypointSprite_DeployPersonal(
entity spr,
+ entity player,
vector ofs,
entity icon // initial icon
)
-{SELFPARAM();
- return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, self, waypointsprite_deployed_personal, false, icon);
+{
+ return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, player, waypointsprite_deployed_personal, false, icon);
}
entity WaypointSprite_Attach(
entity spr,
+ entity player,
float limited_range,
entity icon // initial icon
)
-{SELFPARAM();
+{
float t;
- if (self.waypointsprite_attachedforcarrier)
+ if (player.waypointsprite_attachedforcarrier)
return world; // can't attach to FC
if (teamplay)
- t = self.team;
+ t = player.team;
else
t = 0;
float maxdistance;
maxdistance = waypointsprite_limitedrange;
else
maxdistance = 0;
- return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, self, '0 0 64', world, t, self, waypointsprite_attached, false, icon);
+ return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, player, '0 0 64', world, t, player, waypointsprite_attached, false, icon);
}
entity WaypointSprite_AttachCarrier(
WaypointSprite_Disown(carrier.waypointsprite_attachedforcarrier, waypointsprite_deadlifetime);
}
-void WaypointSprite_ClearPersonal()
-{SELFPARAM();
- WaypointSprite_Kill(self.waypointsprite_deployed_personal);
+void WaypointSprite_ClearPersonal(entity this)
+{
+ WaypointSprite_Kill(this.waypointsprite_deployed_personal);
}
-void WaypointSprite_ClearOwned()
-{SELFPARAM();
- WaypointSprite_Kill(self.waypointsprite_deployed_fixed);
- WaypointSprite_Kill(self.waypointsprite_deployed_personal);
- WaypointSprite_Kill(self.waypointsprite_attached);
+void WaypointSprite_ClearOwned(entity this)
+{
+ WaypointSprite_Kill(this.waypointsprite_deployed_fixed);
+ WaypointSprite_Kill(this.waypointsprite_deployed_personal);
+ WaypointSprite_Kill(this.waypointsprite_attached);
}
void WaypointSprite_PlayerDead(entity this)
WaypointSprite_DetachCarrier(this);
}
-void WaypointSprite_PlayerGone()
-{SELFPARAM();
- WaypointSprite_Disown(self.waypointsprite_deployed_fixed, waypointsprite_deadlifetime);
- WaypointSprite_Kill(self.waypointsprite_deployed_personal);
- WaypointSprite_Disown(self.waypointsprite_attached, waypointsprite_deadlifetime);
- WaypointSprite_DetachCarrier(self);
+void WaypointSprite_PlayerGone(entity this)
+{
+ WaypointSprite_Disown(this.waypointsprite_deployed_fixed, waypointsprite_deadlifetime);
+ WaypointSprite_Kill(this.waypointsprite_deployed_personal);
+ WaypointSprite_Disown(this.waypointsprite_attached, waypointsprite_deadlifetime);
+ WaypointSprite_DetachCarrier(this);
}
#endif
#endif