X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fpickup.qh;h=a391d6861d5f49a8d8f06c5d3f2661fdc2772519;hb=3f19aed0da1ef3afb5eca7bfa53db63d0b98bcc7;hp=1bcbc389950ace48d927602879138988beca896c;hpb=ac7f397ceff9390594c5d9d331449192ba07f6f8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/pickup.qh b/qcsrc/common/items/item/pickup.qh index 1bcbc3899..a391d6861 100644 --- a/qcsrc/common/items/item/pickup.qh +++ b/qcsrc/common/items/item/pickup.qh @@ -2,10 +2,11 @@ #define PICKUP_H #include "../item.qh" CLASS(Pickup, GameItem) - METHOD(Pickup, respondTo, bool(entity, int)) ATTRIB(Pickup, m_model, string, string_null) ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav") ATTRIB(Pickup, m_name, string, string_null) + METHOD(Pickup, show, void(entity this)) + void Pickup_show(entity this) { printf("%s\n", this.m_name); } #ifdef SVQC ATTRIB(Pickup, m_botvalue, int, 0) ATTRIB(Pickup, m_itemflags, int, 0) @@ -13,13 +14,16 @@ CLASS(Pickup, GameItem) ATTRIB(Pickup, m_pickupevalfunc, float(entity player, entity item), generic_pickupevalfunc) ATTRIB(Pickup, m_respawntime, float(), func_null) ATTRIB(Pickup, m_respawntimejitter, float(), func_null) + METHOD(Pickup, giveTo, bool(entity this, entity item, entity player)) + bool Pickup_giveTo(entity this, entity item, entity player) { return Item_GiveTo(item, player); } + bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) { printf("%s picked up %s\n", etos(player), this.m_name); return this.giveTo(this, item, player); } #endif ENDCLASS(Pickup) #ifdef SVQC // For g_pickup_respawntime #include "../../../server/defs.qh" -// Getters to dynamically retrieve the values of g_pickup_respawntime* as they aren't autocvars +// Getters to dynamically retrieve the values of g_pickup_respawntime* GETTER(float, g_pickup_respawntime_weapon) GETTER(float, g_pickup_respawntime_superweapon) GETTER(float, g_pickup_respawntime_ammo) @@ -34,16 +38,7 @@ GETTER(float, g_pickup_respawntimejitter_short) GETTER(float, g_pickup_respawntimejitter_medium) GETTER(float, g_pickup_respawntimejitter_long) GETTER(float, g_pickup_respawntimejitter_powerup) -#endif -bool Pickup_respondTo(entity this, int request) -{ - switch (request) { - default: return false; - case ITEM_SIGNAL(Default): - print(strcat(this.m_name, " responding\n")); - return true; - } -} +#endif #endif