From: terencehill Date: Sat, 6 Mar 2021 19:02:08 +0000 (+0100) Subject: Remove outdated flag list from WaypointSprite_SendEntity/Ent_WaypointSprite; give... X-Git-Tag: xonotic-v0.8.5~523 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=362520c71bd04d82887b0ee12b39611bb7f28903;p=xonotic%2Fxonotic-data.pk3dir.git Remove outdated flag list from WaypointSprite_SendEntity/Ent_WaypointSprite; give a variable a meaningful name; remove redundant classname assignment --- diff --git a/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc index 1492c6d06..477cfb0d0 100644 --- a/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc +++ b/qcsrc/common/gamemodes/gamemode/assault/sv_assault.qc @@ -129,7 +129,6 @@ void target_objective_decrease_activate(entity this) spr = WaypointSprite_SpawnFixed(WP_AssaultDefend, 0.5 * (it.absmin + it.absmax), it, assault_sprite, RADARICON_OBJECTIVE); spr.assault_decreaser = this; spr.waypointsprite_visible_for_player = assault_decreaser_sprite_visible; - spr.classname = "sprite_waypoint"; WaypointSprite_UpdateRule(spr, assault_attacker_team, SPRITERULE_TEAMPLAY); if(it.classname == "func_assault_destructible") { diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index d3a9806e0..043ee6853 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -5,7 +5,6 @@ REGISTER_MUTATOR(waypointsprites, true); REGISTER_NET_LINKED(waypointsprites) #ifdef SVQC -/** flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] */ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags) { WriteHeader(MSG_ENTITY, waypointsprites); @@ -15,17 +14,14 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags) if (this.max_health || (this.pain_finished && (time < this.pain_finished + 0.25))) sendflags |= 0x80; - int f = 0; - if(this.currentammo == 1) - f |= 1; // hideable - if(this.exteriormodeltoclient == to) - f |= 2; // my own - if(this.currentammo == 2) - f |= 2; // radar only + int hide_flags = 0; + if(this.currentammo == 1) hide_flags |= 1; // hideable + else if(this.currentammo == 2) hide_flags |= 2; // radar only + if(this.exteriormodeltoclient == to) hide_flags |= 2; // my own - MUTATOR_CALLHOOK(SendWaypoint, this, to, sendflags, f); + MUTATOR_CALLHOOK(SendWaypoint, this, to, sendflags, hide_flags); sendflags = M_ARGV(2, int); - f = M_ARGV(3, int); + hide_flags = M_ARGV(3, int); WriteByte(MSG_ENTITY, sendflags); WriteByte(MSG_ENTITY, this.wp_extra); @@ -70,7 +66,7 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags) WriteCoord(MSG_ENTITY, this.fade_time); WriteCoord(MSG_ENTITY, this.teleport_time); WriteShort(MSG_ENTITY, this.fade_rate); // maxdist - WriteByte(MSG_ENTITY, f); + WriteByte(MSG_ENTITY, hide_flags); } if (sendflags & 32) @@ -107,7 +103,6 @@ void Ent_RemoveWaypointSprite(entity this) strfree(this.netname3); } -/** flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] */ void Ent_WaypointSprite(entity this, bool isnew) { int sendflags = ReadByte();