The cvars were read before the settemps were applied.
When StartItem() calls .m_iteminit() the settemps have been applied.
float autocvar_g_balance_powerup_invisibility_time = 30;
void powerup_invisibility_init(Pickup this, entity item)
{
+ if(autocvar_g_powerups_invisibility)
+ this.spawnflags = ITEM_FLAG_NORMAL;
+ else
+ this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+
if(!item.invisibility_finished)
item.invisibility_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invisibility_time;
}
REGISTER_ITEM(Invisibility, Powerup) {
this.m_canonical_spawnfunc = "item_invisibility";
#ifdef SVQC
- if(autocvar_g_powerups_invisibility)
- this.spawnflags = ITEM_FLAG_NORMAL;
- else
- this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
-
this.m_iteminit = powerup_invisibility_init;
#endif
#ifdef GAMEQC
float autocvar_g_balance_powerup_invincible_time;
void powerup_shield_init(Pickup this, entity item)
{
+ if(autocvar_g_powerups_shield)
+ this.spawnflags = ITEM_FLAG_NORMAL;
+ else
+ this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+
if(!item.invincible_finished)
item.invincible_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invincible_time;
}
REGISTER_ITEM(Shield, Powerup) {
this.m_canonical_spawnfunc = "item_shield";
#ifdef SVQC
- if(autocvar_g_powerups_shield)
- this.spawnflags = ITEM_FLAG_NORMAL;
- else
- this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
-
this.m_iteminit = powerup_shield_init;
#endif
#ifdef GAMEQC
float autocvar_g_balance_powerup_speed_time = 30;
void powerup_speed_init(Pickup this, entity item)
{
+ if(autocvar_g_powerups_speed)
+ this.spawnflags = ITEM_FLAG_NORMAL;
+ else
+ this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+
if(!item.speed_finished)
item.speed_finished = (item.count) ? item.count : autocvar_g_balance_powerup_speed_time;
}
REGISTER_ITEM(Speed, Powerup) {
this.m_canonical_spawnfunc = "item_speed";
#ifdef SVQC
- if(autocvar_g_powerups_speed)
- this.spawnflags = ITEM_FLAG_NORMAL;
- else
- this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
-
this.m_iteminit = powerup_speed_init;
#endif
#ifdef GAMEQC
float autocvar_g_balance_powerup_strength_time;
void powerup_strength_init(Pickup this, entity item)
{
+ if(autocvar_g_powerups_strength)
+ this.spawnflags = ITEM_FLAG_NORMAL;
+ else
+ this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+
if(!item.strength_finished)
item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time;
}
REGISTER_ITEM(Strength, Powerup) {
this.m_canonical_spawnfunc = "item_strength";
#ifdef SVQC
- if(autocvar_g_powerups_strength)
- this.spawnflags = ITEM_FLAG_NORMAL;
- else
- this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
-
this.m_iteminit = powerup_strength_init;
#endif
#ifdef GAMEQC