]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
Draw: purge SELFPARAM
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / waypoints / waypointsprites.qc
index c1bb62da15d699c1e488bc289409b93c46b3b1f1..9adf1a95bac36b74e3a5dbd046ae630b820c77db 100644 (file)
@@ -4,8 +4,8 @@ REGISTER_MUTATOR(waypointsprites, true);
 
 #ifdef SVQC
 /** flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] */
-float WaypointSprite_SendEntity(entity to, float sendflags)
-{SELFPARAM();
+bool WaypointSprite_SendEntity(entity this, entity to, float sendflags)
+{
     WriteMutator(MSG_ENTITY, waypointsprites);
 
     sendflags = sendflags & 0x7F;
@@ -237,22 +237,16 @@ float spritelookupblinkvalue(string s)
         if (get_weaponinfo(self.wp_extra).spawnflags & WEP_FLAG_SUPERWEAPON)
             return 2;
     }
-    if (s == WP_Item.netname) return ITEMS[self.wp_extra].m_waypointblink;
+    if (s == WP_Item.netname) return Items[self.wp_extra].m_waypointblink;
 
-    switch (s)
-    {
-        case "item-invis":       return 2;
-        case "item-extralife":   return 2;
-        case "item-speed":       return 2;
-        default:                 return 1;
-    }
+    return 1;
 }
 
 vector spritelookupcolor(string s, vector def)
 {SELFPARAM();
     if (s == WP_Weapon.netname) return get_weaponinfo(self.wp_extra).wpcolor;
-    if (s == WP_Item.netname) return ITEMS[self.wp_extra].m_color;
-    if (s == WP_Buff.netname) return BUFFS[self.wp_extra].m_color;
+    if (s == WP_Item.netname) return Items[self.wp_extra].m_color;
+    if (s == WP_Buff.netname) return Buffs[self.wp_extra].m_color;
     return def;
 }
 
@@ -260,22 +254,16 @@ string spritelookuptext(string s)
 {SELFPARAM();
     if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start");
     if (s == WP_Weapon.netname) return get_weaponinfo(self.wp_extra).message;
-    if (s == WP_Item.netname) return ITEMS[self.wp_extra].m_waypoint;
-    if (s == WP_Buff.netname) return BUFFS[self.wp_extra].m_prettyName;
+    if (s == WP_Item.netname) return Items[self.wp_extra].m_waypoint;
+    if (s == WP_Buff.netname) return Buffs[self.wp_extra].m_prettyName;
     if (s == WP_Monster.netname) return get_monsterinfo(self.wp_extra).monster_name;
 
     // need to loop, as our netname could be one of three
-    FOREACH(WAYPOINTS, it.netname == s, LAMBDA(
+    FOREACH(Waypoints, it.netname == s, LAMBDA(
         return it.m_name;
     ));
 
-    switch (s)
-    {
-        case "item-invis": return _("Invisibility");
-        case "item-extralife": return _("Extra life");
-        case "item-speed": return _("Speed");
-        default: return s;
-    }
+    return s;
 }
 #endif
 
@@ -467,8 +455,8 @@ vector fixrgbexcess(vector rgb)
     return rgb;
 }
 
-void Draw_WaypointSprite()
-{SELFPARAM();
+void Draw_WaypointSprite(entity this)
+{
     if (self.lifetime)
         self.alpha = pow(bound(0, (self.fadetime - time) / self.lifetime, 1), waypointsprite_timealphaexponent);
     else
@@ -996,7 +984,7 @@ float WaypointSprite_Customize()
     return self.waypointsprite_visible_for_player(e);
 }
 
-float WaypointSprite_SendEntity(entity to, float sendflags);
+bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
 
 void WaypointSprite_Reset()
 {SELFPARAM();