From: Mario Date: Sun, 1 Nov 2020 12:20:22 +0000 (+1000) Subject: Fix compilation unit test X-Git-Tag: xonotic-v0.8.5~698 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=19a67a8f1369ec9eb80b6e88d9d6824e4b3267b1;p=xonotic%2Fxonotic-data.pk3dir.git Fix compilation unit test --- diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index fe62c6737..66cd90072 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -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); +} diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh index bc571261c..0a39b35eb 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qh @@ -1,8 +1,10 @@ #pragma once +#include + #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"); @@ -10,8 +12,7 @@ REGISTER_MUTATOR(buffs, autocvar_g_buffs) { MUTATOR_ONADD { - if(autocvar_g_buffs > 0) - InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET); + buffs_Initialize(); } } diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 22cb54abc..36932f0ce 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -2,6 +2,7 @@ #include #include +#include #include #include #include