From: Mario Date: Sun, 17 Jun 2018 11:58:35 +0000 (+1000) Subject: Add an item flag to mark items as resources (as opposed to items you collect in an... X-Git-Tag: xonotic-v0.8.5~2025 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=802eb50f88ca2d7dbe4905be3c50269cf5409eb0;p=xonotic%2Fxonotic-data.pk3dir.git Add an item flag to mark items as resources (as opposed to items you collect in an inventory) --- diff --git a/qcsrc/common/items/item.qh b/qcsrc/common/items/item.qh index 31b8f43cb..3109e7c92 100644 --- a/qcsrc/common/items/item.qh +++ b/qcsrc/common/items/item.qh @@ -72,7 +72,8 @@ const int IT_PICKUPMASK = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FU enum { ITEM_FLAG_NORMAL = BIT(0), ///< Item is usable during normal gameplay. - ITEM_FLAG_MUTATORBLOCKED = BIT(1) + ITEM_FLAG_MUTATORBLOCKED = BIT(1), + ITEM_FLAG_RESOURCE = BIT(2) ///< Item is is a resource, not a held item. }; #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__) diff --git a/qcsrc/common/items/item/ammo.qh b/qcsrc/common/items/item/ammo.qh index c7b3e0a6c..f59bcad22 100644 --- a/qcsrc/common/items/item/ammo.qh +++ b/qcsrc/common/items/item/ammo.qh @@ -54,7 +54,7 @@ ENDCLASS(Bullets) REGISTER_ITEM(Bullets, Bullets) { this.m_canonical_spawnfunc = "item_bullets"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_Bullets_ITEM; #endif this.netname = "bullets"; @@ -84,7 +84,7 @@ void ammo_cells_init(Pickup this, entity item) REGISTER_ITEM(Cells, Ammo) { this.m_canonical_spawnfunc = "item_cells"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_Cells_ITEM; #endif this.netname = "cells"; @@ -114,7 +114,7 @@ void ammo_plasma_init(Pickup this, entity item) REGISTER_ITEM(Plasma, Ammo) { this.m_canonical_spawnfunc = "item_plasma"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_Plasma_ITEM; #endif this.netname = "plasma"; @@ -144,7 +144,7 @@ void ammo_rockets_init(Pickup this, entity item) REGISTER_ITEM(Rockets, Ammo) { this.m_canonical_spawnfunc = "item_rockets"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_Rockets_ITEM; #endif this.netname = "rockets"; @@ -178,7 +178,7 @@ ENDCLASS(Shells) REGISTER_ITEM(Shells, Shells) { this.m_canonical_spawnfunc = "item_shells"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_Shells_ITEM; #endif this.netname = "shells"; diff --git a/qcsrc/common/items/item/armor.qh b/qcsrc/common/items/item/armor.qh index 31ae43721..ee39aa592 100644 --- a/qcsrc/common/items/item/armor.qh +++ b/qcsrc/common/items/item/armor.qh @@ -34,7 +34,7 @@ void item_armorsmall_init(Pickup this, entity item) REGISTER_ITEM(ArmorSmall, Armor) { this.m_canonical_spawnfunc = "item_armor_small"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_ArmorSmall_ITEM; this.m_sound = SND_ArmorSmall; #endif @@ -72,7 +72,7 @@ void item_armormedium_init(Pickup this, entity item) REGISTER_ITEM(ArmorMedium, Armor) { this.m_canonical_spawnfunc = "item_armor_medium"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_ArmorMedium_ITEM; this.m_sound = SND_ArmorMedium; #endif @@ -110,7 +110,7 @@ void item_armorbig_init(Pickup this, entity item) REGISTER_ITEM(ArmorBig, Armor) { this.m_canonical_spawnfunc = "item_armor_big"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_ArmorBig_ITEM; this.m_sound = SND_ArmorBig; #endif @@ -150,7 +150,7 @@ void item_armormega_init(Pickup this, entity item) REGISTER_ITEM(ArmorMega, Armor) { this.m_canonical_spawnfunc = "item_armor_mega"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_ArmorMega_ITEM; this.m_sound = SND_ArmorMega; #endif diff --git a/qcsrc/common/items/item/health.qh b/qcsrc/common/items/item/health.qh index c2f1b5cbe..bf515fe4d 100644 --- a/qcsrc/common/items/item/health.qh +++ b/qcsrc/common/items/item/health.qh @@ -34,7 +34,7 @@ void item_healthsmall_init(Pickup this, entity item) REGISTER_ITEM(HealthSmall, Health) { this.m_canonical_spawnfunc = "item_health_small"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_HealthSmall_ITEM; this.m_sound = SND_HealthSmall; #endif @@ -72,7 +72,7 @@ void item_healthmedium_init(Pickup this, entity item) REGISTER_ITEM(HealthMedium, Health) { this.m_canonical_spawnfunc = "item_health_medium"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_HealthMedium_ITEM; this.m_sound = SND_HealthMedium; #endif @@ -110,7 +110,7 @@ void item_healthbig_init(Pickup this, entity item) REGISTER_ITEM(HealthBig, Health) { this.m_canonical_spawnfunc = "item_health_big"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_HealthBig_ITEM; this.m_sound = SND_HealthBig; #endif @@ -150,7 +150,7 @@ void item_healthmega_init(Pickup this, entity item) REGISTER_ITEM(HealthMega, Health) { this.m_canonical_spawnfunc = "item_health_mega"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_HealthMega_ITEM; this.m_sound = SND_HealthMega; #endif diff --git a/qcsrc/common/items/item/jetpack.qh b/qcsrc/common/items/item/jetpack.qh index e03c1ae6d..760033861 100644 --- a/qcsrc/common/items/item/jetpack.qh +++ b/qcsrc/common/items/item/jetpack.qh @@ -64,7 +64,7 @@ void ammo_fuel_init(Pickup this, entity item) REGISTER_ITEM(JetpackFuel, Ammo) { this.m_canonical_spawnfunc = "item_fuel"; #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; + this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; this.m_model = MDL_JetpackFuel_ITEM; #endif this.netname = "fuel";