]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix compilation unit test
authorMario <mario.mario@y7mail.com>
Sun, 1 Nov 2020 12:20:22 +0000 (22:20 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 1 Nov 2020 12:20:22 +0000 (22:20 +1000)
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qh
qcsrc/server/items/items.qc

index fe62c673717fab19379b50befcf4509d510683d7..66cd9007216fc9febac289c4bf115434b57afa52 100644 (file)
@@ -1027,3 +1027,10 @@ void buffs_DelayedInit(entity this)
                }
        }
 }
                }
        }
 }
+
+void buffs_Initialize()
+{
+       // if buffs are above 0, allow random spawning
+       if(autocvar_g_buffs > 0 && autocvar_g_buffs_spawn_count > 0)
+               InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET);
+}
index bc571261cee78ef2d33f255ea5453b412ae4339a..0a39b35eb42a0a486d1fb7b2cf4e0a8372c5dd76 100644 (file)
@@ -1,8 +1,10 @@
 #pragma once
 
 #pragma once
 
+#include <common/mutators/base.qh>
+
 #include "buffs.qh"
 
 #include "buffs.qh"
 
-void buffs_DelayedInit(entity this);
+void buffs_Initialize();
 
 AUTOCVAR(g_buffs, int, -1, "Enable buffs, -1: enabled but no auto location or replacing powerups, 1: enabled and can replace them");
 
 
 AUTOCVAR(g_buffs, int, -1, "Enable buffs, -1: enabled but no auto location or replacing powerups, 1: enabled and can replace them");
 
@@ -10,8 +12,7 @@ REGISTER_MUTATOR(buffs, autocvar_g_buffs)
 {
        MUTATOR_ONADD
        {
 {
        MUTATOR_ONADD
        {
-               if(autocvar_g_buffs > 0)
-                       InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET);
+               buffs_Initialize();
        }
 }
 
        }
 }
 
index 22cb54abc1d3effee04dd6f993d08e6a614e4504..36932f0cef3f490a3bbff2f85e09033e49e25e8e 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <common/constants.qh>
 #include <common/deathtypes/all.qh>
 
 #include <common/constants.qh>
 #include <common/deathtypes/all.qh>
+#include <common/gamemodes/gamemode/cts/cts.qh>
 #include <common/items/_mod.qh>
 #include <common/mapobjects/subs.qh>
 #include <common/mapobjects/triggers.qh>
 #include <common/items/_mod.qh>
 #include <common/mapobjects/subs.qh>
 #include <common/mapobjects/triggers.qh>