]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
q3compat: support the count field on health items
authorbones_was_here <bones_was_here@xa.org.au>
Mon, 19 Oct 2020 06:08:51 +0000 (16:08 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Mon, 19 Oct 2020 06:08:51 +0000 (16:08 +1000)
qcsrc/common/items/item/health.qh
qcsrc/server/items/items.qh

index 27f5dafc6e2019e9d8ac13669e323a18451dd11c..0d9992f0ec167575abc3a10f54bc67a29b6f8105 100644 (file)
@@ -27,7 +27,7 @@ void item_healthsmall_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthsmall_max;
     if(!GetResource(item, RES_HEALTH))
-        SetResourceExplicit(item, RES_HEALTH, g_pickup_healthsmall);
+        SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthsmall);
 }
 #endif
 
@@ -65,7 +65,7 @@ void item_healthmedium_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthmedium_max;
     if(!GetResource(item, RES_HEALTH))
-        SetResourceExplicit(item, RES_HEALTH, g_pickup_healthmedium);
+        SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthmedium);
 }
 #endif
 
@@ -103,7 +103,7 @@ void item_healthbig_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthbig_max;
     if(!GetResource(item, RES_HEALTH))
-        SetResourceExplicit(item, RES_HEALTH, g_pickup_healthbig);
+        SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthbig);
 }
 #endif
 
@@ -143,7 +143,7 @@ void item_healthmega_init(Pickup this, entity item)
     if(!item.max_health)
         item.max_health = g_pickup_healthmega_max;
     if(!GetResource(item, RES_HEALTH))
-        SetResourceExplicit(item, RES_HEALTH, g_pickup_healthmega);
+        SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : g_pickup_healthmega);
 }
 #endif
 
index 49fea39d092e0bb74b2336acaba73e99cba57921..5bf040f506d60fb8538adf9845e21c7f811c3597 100644 (file)
@@ -20,6 +20,7 @@ const float ITEM_RESPAWN_TICKS = 10;
 
 .float max_armorvalue;
 .float pickup_anyway;
+.int count;
 
 .float scheduledrespawntime;
 .float respawntime;