#define WITH(it) this.m_##it;
#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
-#define DEFINE(id, ...) \
- REGISTER_ITEM(id, Ammo, LAMBDA( \
- IF(SV, CONFIGURE \
- , respawntime = SPAWNTIME_AMMO \
- , respawntimejitter = SPAWNTIME_AMMO \
- ) \
- MAP(IDENTITY, __VA_ARGS__) \
+#define DEFINE(id, ...) \
+ REGISTER_ITEM(id, Ammo, LAMBDA( \
+ IF(SV, CONFIGURE \
+ , respawntime = g_pickup_respawntime_ammo \
+ , respawntimejitter = g_pickup_respawntimejitter_ammo \
+ ) \
+ MAP(IDENTITY, __VA_ARGS__) \
))
DEFINE(Bullets
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_LOW
- , respawntime = SPAWNTIME_SHORT
- , respawntimejitter = SPAWNTIME_SHORT
+ , respawntime = g_pickup_respawntime_short
+ , respawntimejitter = g_pickup_respawntimejitter_short
)
)
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_MID
- , respawntime = SPAWNTIME_MEDIUM
- , respawntimejitter = SPAWNTIME_MEDIUM
+ , respawntime = g_pickup_respawntime_medium
+ , respawntimejitter = g_pickup_respawntimejitter_medium
)
)
)
,IF(SV, CONFIGURE
, botvalue = 20000 // FIXME: higher than BOT_PICKUP_RATING_HIGH?
- , respawntime = SPAWNTIME_LONG
- , respawntimejitter = SPAWNTIME_LONG
+ , respawntime = g_pickup_respawntime_long
+ , respawntimejitter = g_pickup_respawntimejitter_long
)
)
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_HIGH
- , respawntime = SPAWNTIME_LONG
- , respawntimejitter = SPAWNTIME_LONG
+ , respawntime = g_pickup_respawntime_long
+ , respawntimejitter = g_pickup_respawntimejitter_long
)
)
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_LOW
- , respawntime = SPAWNTIME_SHORT
- , respawntimejitter = SPAWNTIME_SHORT
+ , respawntime = g_pickup_respawntime_short
+ , respawntimejitter = g_pickup_respawntimejitter_short
)
)
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_MID
- , respawntime = SPAWNTIME_SHORT
- , respawntimejitter = SPAWNTIME_SHORT
+ , respawntime = g_pickup_respawntime_short
+ , respawntimejitter = g_pickup_respawntimejitter_short
)
)
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_MID
- , respawntime = SPAWNTIME_MEDIUM
- , respawntimejitter = SPAWNTIME_MEDIUM
+ , respawntime = g_pickup_respawntime_medium
+ , respawntimejitter = g_pickup_respawntimejitter_medium
)
)
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_HIGH
- , respawntime = SPAWNTIME_LONG
- , respawntimejitter = SPAWNTIME_LONG
+ , respawntime = g_pickup_respawntime_long
+ , respawntimejitter = g_pickup_respawntimejitter_long
)
)
#endif
ENDCLASS(Pickup)
-#define SPAWNTIMES(_) \
- _(WEAPON, weapon) \
- _(AMMO, ammo) \
- _(SHORT, short) \
- _(MEDIUM, medium) \
- _(LONG, long) \
- /**/
-
-#define SPAWNTIMES_ENUM(id, idlc) SPAWNTIME_##id ,
-enum { SPAWNTIMES(SPAWNTIMES_ENUM) };
-#undef SPAWNTIMES_ENUM
-
#ifdef SVQC
+// For g_pickup_respawntime
#include "../../../server/defs.qh"
-
-#define SPAWNTIMES_MAP(id, idlc) i == SPAWNTIME_##id ? g_pickup_respawntime_##idlc :
-[[inline]] int spawntime(int i) { return SPAWNTIMES(SPAWNTIMES_MAP) 0; }
-#undef SPAWNTIMES_MAP
-
-#define SPAWNTIMES_MAP(id, idlc) i == SPAWNTIME_##id ? g_pickup_respawntimejitter_##idlc :
-[[inline]] int spawntimejitter(int i) { return SPAWNTIMES(SPAWNTIMES_MAP) 0; }
-#undef SPAWNTIMES_MAP
#endif
bool Pickup_respondTo(entity this, int request)
void StartItemA (entity a)
{
- StartItem(a.m_model, a.m_sound, spawntime(a.m_respawntime), spawntimejitter(a.m_respawntimejitter), a.m_name, a.m_itemid, 0, 0, commodity_pickupevalfunc, a.m_botvalue);
+ StartItem(a.m_model, a.m_sound, a.m_respawntime, a.m_respawntimejitter, a.m_name, a.m_itemid, 0, 0, commodity_pickupevalfunc, a.m_botvalue);
}
void spawnfunc_item_rockets (void) {