From: bones_was_here Date: Mon, 19 Oct 2020 06:08:51 +0000 (+1000) Subject: q3compat: support the count field on health items X-Git-Tag: xonotic-v0.8.5~352^2~15 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0d74763954fe18cfdfd2f540094355de52baa7ad;p=xonotic%2Fxonotic-data.pk3dir.git q3compat: support the count field on health items --- diff --git a/qcsrc/common/items/item/health.qh b/qcsrc/common/items/item/health.qh index 27f5dafc6..0d9992f0e 100644 --- a/qcsrc/common/items/item/health.qh +++ b/qcsrc/common/items/item/health.qh @@ -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 diff --git a/qcsrc/server/items/items.qh b/qcsrc/server/items/items.qh index 49fea39d0..5bf040f50 100644 --- a/qcsrc/server/items/items.qh +++ b/qcsrc/server/items/items.qh @@ -20,6 +20,7 @@ const float ITEM_RESPAWN_TICKS = 10; .float max_armorvalue; .float pickup_anyway; +.int count; .float scheduledrespawntime; .float respawntime;