]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item/armor.qh
Merge branch 'bones_was_here/doxygen' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / armor.qh
index 469288b77b367ca86eb8bc198145d93e25f6f98f..f8cabaa0595f08bacfde5fbf9b14c5ffae0654d4 100644 (file)
@@ -11,7 +11,7 @@ CLASS(Armor, Pickup)
 ENDCLASS(Armor)
 
 #ifdef SVQC
-    #include <common/items.qh>
+    #include <server/items/items.qh>
 #endif
 
 #ifdef GAMEQC
@@ -40,7 +40,11 @@ REGISTER_ITEM(ArmorSmall, Armor) {
 #endif
     this.netname                =   "armor_small";
     this.m_name                 =   _("Small armor");
-    this.m_icon                 =   "armor";
+    this.m_icon                 =   "armor_small";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
 #ifdef SVQC
     this.m_itemid               =   IT_RESOURCE;
     this.m_respawntime          =   GET(g_pickup_respawntime_short);
@@ -78,7 +82,11 @@ REGISTER_ITEM(ArmorMedium, Armor) {
 #endif
     this.netname                =   "armor_medium";
     this.m_name                 =   _("Medium armor");
-    this.m_icon                 =   "armor";
+    this.m_icon                 =   "armor_medium";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
 #ifdef SVQC
     this.m_itemid               =   IT_RESOURCE;
     this.m_respawntime          =   GET(g_pickup_respawntime_medium);
@@ -116,7 +124,11 @@ REGISTER_ITEM(ArmorBig, Armor) {
 #endif
     this.netname                =   "armor_big";
     this.m_name                 =   _("Big armor");
-    this.m_icon                 =   "armor";
+    this.m_icon                 =   "armor_big";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
     this.m_color                =   '0 1 0';
     this.m_waypoint             =   _("Big armor");
 #ifdef SVQC
@@ -156,7 +168,11 @@ REGISTER_ITEM(ArmorMega, Armor) {
 #endif
     this.netname                =   "armor_mega";
     this.m_name                 =   _("Mega armor");
-    this.m_icon                 =   "item_large_armor";
+    this.m_icon                 =   "armor_mega";
+#ifdef CSQC
+    if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "")
+       this.m_icon             =   "item_large_armor"; // compatible with Xonotic v0.8.2 or lower
+#endif
     this.m_color                =   '0 1 0';
     this.m_waypoint             =   _("Mega armor");
     this.m_waypointblink        =   2;