bool autocvar_g_instagib;
int autocvar_g_instagib_extralives;
-/// \brief Time of invisibility powerup in seconds.
float autocvar_g_instagib_invisibility_time;
-/// \brief Time of speed powerup in seconds.
float autocvar_g_instagib_speed_time;
IntrusiveList g_instagib_items;
gettouch(this)(this, actor);
}
+// if defaultrespawntime is 0 get respawntime from the item definition
+// if defaultrespawntimejitter is 0 get respawntimejitter from the item definition
void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter)
{
string itemname = def.m_name;
this.classname = def.m_canonical_spawnfunc;
- _StartItem(
- this,
- this.itemdef = def,
- 0, // call def.m_respawntime() to get defaultrespawntime
- 0 // call def.m_respawntimejitter() to get defaultrespawntimejitter
- );
+ this.itemdef = def;
+ _StartItem(this, this.itemdef, 0, 0);
}
#define IS_SMALL(def) ((def.instanceOfHealth && def == ITEM_HealthSmall) || (def.instanceOfArmor && def == ITEM_ArmorSmall))
this.glowmod = colormapPaletteColor(this.owner.clientcolors & 0x0F, true);
GameItem def = wpn.m_pickup;
- _StartItem(
- this,
- this.itemdef = def,
- this.respawntime, // defaultrespawntime
- this.respawntimejitter // defaultrespawntimejitter
- );
+ this.itemdef = def;
+ _StartItem(this, this.itemdef, this.respawntime, this.respawntimejitter);
+
#if 0 // WEAPONTODO
if (this.modelindex) { // don't precache if this was removed
wpn.wr_init(wpn);
{
k = bufstr_get(h, i);
-#define BADPREFIX(p) if(substring(k, 0, strlen(p)) == p) continue
-#define BADPRESUFFIX(p,s) if(substring(k, 0, strlen(p)) == p && substring(k, -strlen(s), -1) == s) continue
+#define BADPREFIX_COND(p) (substring(k, 0, strlen(p)) == p)
+#define BADSUFFIX_COND(s) (substring(k, -strlen(s), -1) == s)
+
+#define BADPREFIX(p) if(BADPREFIX_COND(p)) continue
+#define BADPRESUFFIX(p, s) if(BADPREFIX_COND(p) && BADSUFFIX_COND(s)) continue
#define BADCVAR(p) if(k == p) continue
#define BADVALUE(p, val) if (k == p && v == val) continue
-#define BADPRESUFFIXVALUE(p,s,val) if(substring(k, 0, strlen(p)) == p && substring(k, -strlen(s), -1) == s && v == val) continue
+#define BADPRESUFFIXVALUE(p, s, val) if(BADPREFIX_COND(p) && BADSUFFIX_COND(s) && v == val) continue
// general excludes and namespaces for server admin used cvars
BADPREFIX("help_"); // PN's server has this listed as changed, let's not rat him out for THAT