]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
Merge branch 'terencehill/il_loop_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index 8566b5cdb408615271369f64c2978eafb7d3b1d5..df6490128aa993ac84239930a0a477336d078fc0 100644 (file)
@@ -5,8 +5,10 @@
 #include <common/items/_mod.qh>
 #include <common/mapobjects/platforms.qh>
 #include <common/monsters/_mod.qh>
+#include <common/mutators/mutator/status_effects/_mod.qh>
 #include <common/net_linked.qh>
 #include <common/notifications/all.qh>
+#include <common/resources/sv_resources.qh>
 #include <common/state.qh>
 #include <common/util.qh>
 #include <common/vehicles/all.qh>
@@ -20,7 +22,6 @@
 #include <server/items/items.qh>
 #include <server/hook.qh>
 #include <server/mutators/_mod.qh>
-#include <server/resources.qh>
 #include <server/round_handler.qh>
 #include <server/weapons/selection.qh>
 #include <server/world.qh>
@@ -164,7 +165,7 @@ void CL_ExteriorWeaponentity_Think(entity this)
        else this.alpha = 1;
 
        Weapon wep = this.owner.(weaponentity).m_weapon;
-       if (wep) this.glowmod = weaponentity_glowmod(wep, this.owner, this.owner.clientcolors, this.owner.(weaponentity));
+       if (wep) this.glowmod = weaponentity_glowmod(wep, this.owner.clientcolors, this.owner.(weaponentity));
        this.colormap = this.owner.colormap;
        this.skin = w_ent.skin;
 
@@ -301,7 +302,8 @@ void weapon_prepareattack_do(entity actor, .entity weaponentity, bool secondary,
        if (this == NULL) return;
        this.state = WS_INUSE;
 
-       actor.spawnshieldtime = min(actor.spawnshieldtime, time);  // kill spawn shield when you fire
+       if(StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) // given this is performed often, perform a lighter check first
+               StatusEffects_remove(STATUSEFFECT_SpawnShield, actor, STATUSEFFECT_REMOVE_CLEAR); // kill spawn shield when you fire
 
        // if the weapon hasn't been firing continuously, reset the timer
        if (attacktime >= 0)
@@ -668,7 +670,7 @@ void W_AttachToShotorg(entity actor, .entity weaponentity, entity flash, vector
        setorigin(flash, offset);
 
        entity xflash = spawn();
-       copyentity(flash, xflash);
+       copyentity_qc(flash, xflash);
 
        flash.viewmodelforclient = actor;