+#include "waypointsprites.qh"
+
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
#include "../common/constants.qh"
#include "../common/util.qh"
#include "../common/buffs.qh"
#include "miscfunctions.qh"
#endif
-..entity owned_by_field;
-.float rule;
-.string model1;
-.string model2;
-.string model3;
-
-.float(entity) waypointsprite_visible_for_player;
-
void WaypointSprite_UpdateSprites(entity e, string m1, string m2, string m3)
{
if(m1 != e.model1)
e.SendFlags |= 32;
}
-.float waypointsprite_pingtime;
-.float waypointsprite_helpmetime;
void WaypointSprite_Ping(entity e)
{
// anti spam
e.SendFlags |= 32;
}
-float waypointsprite_limitedrange, waypointsprite_deployed_lifetime, waypointsprite_deadlifetime;
-
void WaypointSprite_HelpMePing(entity e)
{
WaypointSprite_Ping(e);
waypointsprite_deployed_lifetime = autocvar_sv_waypointsprite_deployed_lifetime;
waypointsprite_deadlifetime = autocvar_sv_waypointsprite_deadlifetime;
}
+
void WaypointSprite_InitClient(entity e)
{
}
return false;
// team waypoints
- if(self.team && self.rule == SPRITERULE_DEFAULT)
+ if(self.rule == SPRITERULE_SPECTATOR)
+ {
+ if(!autocvar_sv_itemstime)
+ return FALSE;
+ if(!warmup_stage && e.classname == "player")
+ return FALSE;
+ }
+ else if(self.team && self.rule == SPRITERULE_DEFAULT)
{
if(self.team != e.team)
return false;
// this is not in SendEntity because it shall run every frame, not just every update
// make spectators see what the player would see
- entity e;
- e = WaypointSprite_getviewentity(other);
+ entity e = WaypointSprite_getviewentity(other);
- if(MUTATOR_CALLHOOK(CustomizeWaypoint))
+ if(MUTATOR_CALLHOOK(CustomizeWaypoint, self, other))
return false;
return self.waypointsprite_visible_for_player(e);
entity WaypointSprite_Spawn(
string spr, // sprite
- float lifetime, float maxdistance, // lifetime, max distance
+ float _lifetime, float maxdistance, // lifetime, max distance
entity ref, vector ofs, // position
entity showto, float t, // show to whom? Use a flag to indicate a team
entity own, .entity ownfield, // remove when own gets killed
entity wp;
wp = spawn();
wp.classname = "sprite_waypoint";
- wp.teleport_time = time + lifetime;
- wp.fade_time = lifetime;
+ wp.teleport_time = time + _lifetime;
+ wp.fade_time = _lifetime;
wp.exteriormodeltoclient = ref;
if(ref)
{
wp.team = t;
wp.owner = own;
wp.currentammo = hideable;
- if(own)
+ if (own)
{
- if(own.ownfield)
- remove(own.ownfield);
- own.ownfield = wp;
+ if (own.(ownfield))
+ remove(own.(ownfield));
+ own.(ownfield) = wp;
wp.owned_by_field = ownfield;
}
wp.fade_rate = maxdistance;
return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, true, icon, rgb);
}
-.entity waypointsprite_deployed_fixed;
entity WaypointSprite_DeployFixed(
string spr,
float limited_range,
return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, self, waypointsprite_deployed_fixed, false, icon, rgb);
}
-.entity waypointsprite_deployed_personal;
entity WaypointSprite_DeployPersonal(
string spr,
vector ofs,
return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, self, waypointsprite_deployed_personal, false, icon, rgb);
}
-.entity waypointsprite_attached;
-.entity waypointsprite_attachedforcarrier;
entity WaypointSprite_Attach(
string spr,
float limited_range,