X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fweaponsystem.qc;h=a37462eae8ed1d40de3365e2785680422d882625;hb=7779bdd488de14ec800782f2904d49a7f5aa33f8;hp=45838350018d2fc87d774dca1131a0696845e2e1;hpb=123a2aeb0c53addf29611e4e2cb27d4dae8ad968;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 458383500..a37462eae 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -60,7 +60,6 @@ vector CL_Weapon_GetShotOrg(int wpn) return ret; } -..entity weaponentity_fld; .float m_alpha; .string w_weaponname; .int w_dmg; @@ -159,7 +158,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); + if (wep) this.glowmod = weaponentity_glowmod(wep, this.owner, this.owner.clientcolors, this.owner.(weaponentity)); this.colormap = this.owner.colormap; CSQCMODEL_AUTOUPDATE(this); @@ -221,8 +220,8 @@ bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary { if ((actor.items & IT_UNLIMITED_WEAPON_AMMO)) return true; bool ammo = false; - if (secondary) ammo = thiswep.wr_checkammo2(thiswep, actor); - else ammo = thiswep.wr_checkammo1(thiswep, actor); + if (secondary) ammo = thiswep.wr_checkammo2(thiswep, actor, weaponentity); + else ammo = thiswep.wr_checkammo1(thiswep, actor, weaponentity); if (ammo) return true; // always keep the Mine Layer if we placed mines, so that we can detonate them if (thiswep == WEP_MINE_LAYER) @@ -244,8 +243,8 @@ bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary // check if the other firing mode has enough ammo bool ammo_other = false; - if (secondary) ammo_other = thiswep.wr_checkammo1(thiswep, actor); - else ammo_other = thiswep.wr_checkammo2(thiswep, actor); + if (secondary) ammo_other = thiswep.wr_checkammo1(thiswep, actor, weaponentity); + else ammo_other = thiswep.wr_checkammo2(thiswep, actor, weaponentity); if (ammo_other) { if (time - actor.prevwarntime > 1) @@ -317,7 +316,7 @@ void weapon_prepareattack_do(entity actor, .entity weaponentity, bool secondary, } ATTACK_FINISHED(actor, slot) = ATTACK_FINISHED(actor, slot) + attacktime * W_WeaponRateFactor(actor); } - actor.(weaponentity).bulletcounter += 1; + this.bulletcounter += 1; // dprint("attack finished ", ftos(ATTACK_FINISHED(actor, slot)), "\n"); } @@ -743,7 +742,7 @@ void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sen } // switch away if the amount of ammo is not enough to keep using this weapon Weapon w = actor.(weaponentity).m_weapon; - if (!(w.wr_checkammo1(w, actor) + w.wr_checkammo2(w, actor))) + if (!(w.wr_checkammo1(w, actor, weaponentity) + w.wr_checkammo2(w, actor, weaponentity))) { actor.clip_load = -1; // reload later W_SwitchToOtherWeapon(actor, weaponentity); @@ -779,9 +778,9 @@ void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sen actor.clip_load = actor.(weapon_load[actor.(weaponentity).m_weapon.m_id]) = -1; } -void W_DropEvent(.void(Weapon, entity actor) event, entity player, float weapon_type, entity weapon_item) +void W_DropEvent(.void(Weapon, entity actor, .entity) event, entity player, float weapon_type, entity weapon_item, .entity weaponentity) { Weapon w = Weapons_from(weapon_type); weapon_dropevent_item = weapon_item; - w.event(w, player); + w.event(w, player, weaponentity); }