]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
Merge branch 'master' into Mario/wepent_experimental
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index a99a3551b31a7b7817c56a93e2c80983a4ff4871..6139f2879cbf8e04718e18f7fc7848710c654532 100644 (file)
@@ -8,12 +8,14 @@
 #include <common/t_items.qh>
 #include <common/animdecide.qh>
 #include <common/constants.qh>
+#include <common/net_linked.qh>
 #include <common/monsters/_mod.qh>
 #include <common/notifications/all.qh>
 #include <common/util.qh>
 #include <common/weapons/_all.qh>
 #include <common/state.qh>
 #include <lib/csqcmodel/sv_model.qh>
+#include <common/wepent.qh>
 
 .int state;
 
@@ -107,15 +109,13 @@ void CL_Weaponentity_Think(entity this)
                this.weaponchild.alpha = this.alpha;
                this.weaponchild.effects = this.effects;
        }
-
-       wepent_update(this);
 }
 
 void CL_ExteriorWeaponentity_Think(entity this)
 {
        this.nextthink = time;
        .entity weaponentity = this.weaponentity_fld;
-       entity wepent = this.owner.(weaponentity);
+       entity w_ent = this.owner.(weaponentity);
        if (this.owner.exteriorweaponentity != this)
        {
                delete(this);
@@ -126,15 +126,15 @@ void CL_ExteriorWeaponentity_Think(entity this)
                this.model = "";
                return;
        }
-       if (this.weaponname != wepent.weaponname || this.dmg != wepent.modelindex
-           || this.deadflag != wepent.deadflag)
+       if (this.weaponname != w_ent.weaponname || this.dmg != w_ent.modelindex
+           || this.deadflag != w_ent.deadflag)
        {
-               this.weaponname = wepent.weaponname;
-               this.dmg = wepent.modelindex;
-               this.deadflag = wepent.deadflag;
-               if (wepent.weaponname != "")
+               this.weaponname = w_ent.weaponname;
+               this.dmg = w_ent.modelindex;
+               this.deadflag = w_ent.deadflag;
+               if (w_ent.weaponname != "")
                {
-                       _setmodel(this, W_Model(strcat("v_", wepent.weaponname, ".md3")));
+                       _setmodel(this, W_Model(strcat("v_", w_ent.weaponname, ".md3")));
                        setsize(this, '0 0 0', '0 0 0');
                }
                else this.model = "";
@@ -634,7 +634,7 @@ void W_AttachToShotorg(entity actor, .entity weaponentity, entity flash, vector
 
 void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use, .entity weaponentity)
 {
-       if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor)) return;
+       if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor, actor.(weaponentity))) return;
 
        if ((actor.items & IT_UNLIMITED_WEAPON_AMMO) && !wep.reloading_ammo) return;