]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/powerups/powerup/strength.qh
powerups: fix #2857 and move g_powerups cvar out of server/items/items.qc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / powerups / powerup / strength.qh
index aea3bcf2f31c74190afddef9749186b428f411f2..79ef229f1cbbf751b5b0a39ac5b76ab7f6fa70d4 100644 (file)
@@ -14,18 +14,16 @@ SOUND(Strength, Item_Sound("powerup"));
 #endif
 
 #ifdef SVQC
-bool autocvar_g_powerups_strength = 1;
+bool autocvar_g_powerups_strength;
 float autocvar_g_balance_powerup_strength_damage;
 float autocvar_g_balance_powerup_strength_force;
 float autocvar_g_balance_powerup_strength_selfdamage;
 float autocvar_g_balance_powerup_strength_selfforce;
 float autocvar_g_balance_powerup_strength_time;
-void powerup_strength_init(Pickup this, entity item)
+void powerup_strength_init(Pickup def, entity item)
 {
-    if(autocvar_g_powerups_strength)
-        this.spawnflags = ITEM_FLAG_NORMAL;
-    else
-        this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+    if(!autocvar_g_powerups || !autocvar_g_powerups_strength)
+        def.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
 
     if(!item.strength_finished)
         item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time;
@@ -37,6 +35,7 @@ REGISTER_ITEM(Strength, Powerup) {
     this.m_iteminit         =   powerup_strength_init;
 #endif
 #ifdef GAMEQC
+    this.spawnflags         =   ITEM_FLAG_NORMAL;
     this.m_itemid           =   IT_STRENGTH;
     this.m_model            =   MDL_Strength_ITEM;
     this.m_sound            =   SND_Strength;