]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/buffs.qc
Translate sprite names on the client
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / buffs.qc
index f9075d05a5c5e63f880ffeb09d638318a614acf1..2f8e0fc23895dd34e773773a8cddf67f6bc266c8 100644 (file)
@@ -34,6 +34,16 @@ float Buff_Type_FromName(string buff_name)
        return 0;
 }
 
+float Buff_Type_FromSprite(string buff_sprite)
+{
+       entity e;
+       for(e = Buff_Type_first; e; e = e.enemy)
+               if(buff_sprite == e.model2)
+                       return e.items;
+       return 0;
+}
+
+
 float Buff_Skin(float buff_id)
 {
        entity e;
@@ -42,3 +52,12 @@ float Buff_Skin(float buff_id)
                        return e.skin;
        return 0;
 }
+
+string Buff_Sprite(float buff_id)
+{
+       entity e;
+       for(e = Buff_Type_first; e; e = e.enemy)
+               if(buff_id == e.items)
+                       return e.model2;
+       return "";
+}