]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix mapinfo settemp of individual powerup cvars
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 13 Mar 2023 15:17:06 +0000 (01:17 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Mon, 13 Mar 2023 17:54:06 +0000 (03:54 +1000)
The cvars were read before the settemps were applied.
When StartItem() calls .m_iteminit() the settemps have been applied.

qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh
qcsrc/common/mutators/mutator/powerups/powerup/shield.qh
qcsrc/common/mutators/mutator/powerups/powerup/speed.qh
qcsrc/common/mutators/mutator/powerups/powerup/strength.qh

index d920aab9f22ed3cf8710e67501e19c054a01b5d2..53264eeb2e2ccd69f72de9d5a1fa2768c7fbd85a 100644 (file)
@@ -21,6 +21,11 @@ float autocvar_g_balance_powerup_invisibility_alpha = 0.15;
 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;
 }
@@ -28,11 +33,6 @@ void powerup_invisibility_init(Pickup this, entity item)
 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
index 508a39487ae84309a8bf106f052a586a03f1967a..d665fb894d37c77eccfe563ed892cb78f4f73183 100644 (file)
@@ -20,6 +20,11 @@ float autocvar_g_balance_powerup_invincible_takeforce = 0.33;
 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;
 }
@@ -27,11 +32,6 @@ void powerup_shield_init(Pickup this, entity item)
 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
index 5b71df8083bd88e45e698fb5b88d6c526280d984..4bda28e35917ffeb02904adad7210048948e0a25 100644 (file)
@@ -22,6 +22,11 @@ float autocvar_g_balance_powerup_speed_highspeed = 1.5;
 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;
 }
@@ -29,11 +34,6 @@ void powerup_speed_init(Pickup this, entity item)
 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
index 9392a6a2d7c9755147633758befbe9252b5405f5..aea3bcf2f31c74190afddef9749186b428f411f2 100644 (file)
@@ -22,6 +22,11 @@ float autocvar_g_balance_powerup_strength_selfforce;
 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;
 }
@@ -29,11 +34,6 @@ void powerup_strength_init(Pickup this, entity item)
 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