}
// buff item
-float buff_Waypoint_visible_for_player(entity plr)
-{SELFPARAM();
- if(!self.owner.buff_active && !self.owner.buff_activetime)
+bool buff_Waypoint_visible_for_player(entity this, entity player, entity view)
+{
+ if(!this.owner.buff_active && !this.owner.buff_activetime)
return false;
- if (plr.buffs)
+ if (view.buffs)
{
- return plr.cvar_cl_buffs_autoreplace == false || plr.buffs != self.owner.buffs;
+ return view.cvar_cl_buffs_autoreplace == false || view.buffs != this.owner.buffs;
}
- return WaypointSprite_visible_for_player(plr);
+ return WaypointSprite_visible_for_player(this, player, view);
}
void buff_Waypoint_Spawn(entity e)
self.nextthink = time; // WHY?!?
}
-float WaypointSprite_visible_for_player(entity e)
-{SELFPARAM();
+bool WaypointSprite_visible_for_player(entity this, entity player, entity view)
+{
// personal waypoints
- if (self.enemy && self.enemy != e)
+ if (this.enemy && this.enemy != view)
return false;
// team waypoints
- if (self.rule == SPRITERULE_SPECTATOR)
+ if (this.rule == SPRITERULE_SPECTATOR)
{
if (!autocvar_sv_itemstime)
return false;
- if (!warmup_stage && IS_PLAYER(e))
+ if (!warmup_stage && IS_PLAYER(view))
return false;
}
- else if (self.team && self.rule == SPRITERULE_DEFAULT)
+ else if (this.team && this.rule == SPRITERULE_DEFAULT)
{
- if (self.team != e.team)
+ if (this.team != view.team)
return false;
- if (!IS_PLAYER(e))
+ if (!IS_PLAYER(view))
return false;
}
if (MUTATOR_CALLHOOK(CustomizeWaypoint, self, other))
return false;
- return self.waypointsprite_visible_for_player(e);
+ return self.waypointsprite_visible_for_player(self, other, e);
}
bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
.string model2;
.string model3;
-.float(entity) waypointsprite_visible_for_player;
+.bool(entity, entity, entity) waypointsprite_visible_for_player;
void WaypointSprite_UpdateSprites(entity e, entity m1, entity m2, entity m3);
void WaypointSprite_Think();
-float WaypointSprite_visible_for_player(entity e);
+bool WaypointSprite_visible_for_player(entity this, entity player, entity view);
entity WaypointSprite_getviewentity(entity e);
if(self.waypointsprite_attached)
{
- setself(self.waypointsprite_attached);
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
- if(self.waypointsprite_visible_for_player(it))
+ if(self.waypointsprite_attached.waypointsprite_visible_for_player(self.waypointsprite_attached, it, it))
{
msg_entity = it;
soundto(MSG_ONE, this, CH_TRIGGER, SND(ITEMRESPAWNCOUNTDOWN), VOL_BASE, ATTEN_NORM); // play respawn sound
}
});
- setself(this);
WaypointSprite_Ping(self.waypointsprite_attached);
//WaypointSprite_UpdateHealth(self.waypointsprite_attached, self.count);
objerror("no objective as target - fix the map!");
}
-float assault_decreaser_sprite_visible(entity e)
-{SELFPARAM();
- entity decreaser;
-
- decreaser = self.assault_decreaser;
-
- if(decreaser.enemy.health >= ASSAULT_VALUE_INACTIVE)
+bool assault_decreaser_sprite_visible(entity this, entity player, entity view)
+{
+ if(this.assault_decreaser.enemy.health >= ASSAULT_VALUE_INACTIVE)
return false;
return true;
float autocvar_g_keepawayball_respawntime;
int autocvar_g_keepawayball_trail_color;
-float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame
+bool ka_ballcarrier_waypointsprite_visible_for_player(entity this, entity player, entity view) // runs on waypoints which are attached to ballcarriers, updates once per frame
{
- if(e.ballcarried)
- if(IS_SPEC(other))
+ if(view.ballcarried)
+ if(IS_SPEC(player))
return false; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
// TODO: Make the ballcarrier lack a waypointsprite whenever they have the invisibility powerup
ScoreRules_basics_end();
}
-float kh_KeyCarrier_waypointsprite_visible_for_player(entity e) // runs all the time
-{SELFPARAM();
- if(!IS_PLAYER(e) || DIFF_TEAM(self, e))
+bool kh_KeyCarrier_waypointsprite_visible_for_player(entity this, entity player, entity view) // runs all the time
+{
+ if(!IS_PLAYER(view) || DIFF_TEAM(this, view))
if(!kh_tracking_enabled)
return false;
return true;
}
-float kh_Key_waypointsprite_visible_for_player(entity e) // ??
-{SELFPARAM();
+bool kh_Key_waypointsprite_visible_for_player(entity this, entity player, entity view)
+{
if(!kh_tracking_enabled)
return false;
- if(!self.owner)
+ if(!this.owner)
return true;
- if(!self.owner.owner)
+ if(!this.owner.owner)
return true;
return false; // draw only when key is not owned
}
checkpoint_passed();
}
-float race_waypointsprite_visible_for_player(entity e)
-{SELFPARAM();
- if(e.race_checkpoint == -1 || self.owner.race_checkpoint == -2)
+bool race_waypointsprite_visible_for_player(entity this, entity player, entity view)
+{
+ if(view.race_checkpoint == -1 || this.owner.race_checkpoint == -2)
return true;
- else if(e.race_checkpoint == self.owner.race_checkpoint)
+ else if(view.race_checkpoint == this.owner.race_checkpoint)
return true;
else
return false;