]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_weaponsystem.qc
Fix compile issues with latest fteqcc
[voretournament/voretournament.git] / data / qcsrc / server / cl_weaponsystem.qc
index 691fecae5c37abf1e453e73175dfe1624399af78..61763b7139bc00b0687edf25bae74b4ad4a94eaf 100644 (file)
@@ -230,8 +230,8 @@ void W_SetupShot_Dir_ProjectileSize(entity ent, vector s_forward, vector mi, vec
                sound (ent, CHAN_WEAPON, snd, VOL_BASE, ATTN_NORM);\r
        }\r
 \r
-       if (ent.items & IT_STRENGTH)\r
-       sound (ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);\r
+       if (ent.items & IT_STRENGTH && maxdamage)\r
+               sound (ent, CHAN_AUTO, "weapons/strength_fire.wav", VOL_BASE, ATTN_NORM);\r
 };\r
 \r
 #define W_SetupShot_ProjectileSize(ent,mi,ma,antilag,recoil,snd,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, v_forward, mi, ma, antilag, recoil, snd, maxdamage)\r
@@ -263,7 +263,7 @@ float CL_ExteriorWeaponentity_CustomizeEntityForClient()
                other = other.enemy; // also do this for the player we are spectating\r
 \r
        if not(chase || other.classname == "observer") // the observer check prevents a bug\r
-       if(other.predator == self.owner || other.fakepredator == self.owner)\r
+       if(other.predator == self.owner)\r
        {\r
                setmodel(self, "");\r
                return TRUE;\r
@@ -272,7 +272,7 @@ float CL_ExteriorWeaponentity_CustomizeEntityForClient()
        self.effects &~= EF_NODEPTHTEST;\r
        if not(self.owner.stat_eaten)\r
                setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3"));\r
-       else if(cvar("g_vore_neighborprey_distance") && (other.predator == self.owner.predator || other.fakepredator == self.owner.predator) && !(chase || other.classname == "observer"))\r
+       else if(cvar("g_vore_neighborprey_distance") && other.predator == self.owner.predator && !(chase || other.classname == "observer"))\r
        {\r
                setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3")); // allow seeing neighboring prey's weapon model\r
                self.effects |= EF_NODEPTHTEST; // don't hide behind the stomach's own EF_NODEPTHTEST\r
@@ -365,6 +365,7 @@ void CL_Weaponentity_Think()
                return;\r
        }\r
        if (self.cnt != self.owner.weapon || self.dmg != self.owner.modelindex || self.deadflag != self.owner.deadflag)\r
+       if (substring(self.owner.model, -4, 4) != ".md3") // not a stomach model\r
        {\r
                self.cnt = self.owner.weapon;\r
                self.dmg = self.owner.modelindex;\r
@@ -751,13 +752,13 @@ void CL_Weaponentity_Think()
 \r
        }\r
 \r
-       // create or update the lasertarget entity\r
-\r
        // if we are a micro or macro, size the weapon model accordingly\r
-       if(self.owner.scale && cvar("g_healthsize_weapon_scalefactor"))\r
+       if(cvar("g_healthsize") && cvar("g_healthsize_weapon_scalefactor"))\r
        if(self.model != "")\r
        {\r
                self.weaponentity.scale = (1 + cvar("g_healthsize_weapon_scalefactor")) - cvar("g_healthsize_weapon_scalefactor") * self.owner.scale;\r
+               if(self.weaponentity.scale < 0.1)\r
+                       self.weaponentity.scale = 0.1; // stuff breaks if scale is smaller than this\r
                self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weapon_scalefactor_pos");\r
        }\r
 };\r
@@ -778,6 +779,7 @@ void CL_ExteriorWeaponentity_Think()
                return;\r
        }\r
        if (self.cnt != self.owner.weapon || self.dmg != self.owner.modelindex || self.deadflag != self.owner.deadflag)\r
+       if (substring(self.owner.model, -4, 4) != ".md3") // not a stomach model\r
        {\r
                self.cnt = self.owner.weapon;\r
                self.dmg = self.owner.modelindex;\r
@@ -792,7 +794,7 @@ void CL_ExteriorWeaponentity_Think()
                        self.tag_index = tag_found;\r
                        self.tag_entity = self.owner;\r
                }\r
-               else if(substring(self.owner.model, -4, 4) != ".md3") // not a stomach model\r
+               else\r
                        setattachment(self, self.owner, "bip01 r hand");\r
 \r
                // if that didn't find a tag, hide the exterior weapon model\r
@@ -1586,7 +1588,7 @@ void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)
        if(ammo_reload)\r
        {\r
                self.clip_load -= ammo_use;\r
-               self.weapon_load[self.weapon] = self.clip_load;\r
+               self.(weapon_load[self.weapon]) = self.clip_load;\r
        }\r
        else\r
                self.(self.current_ammo) -= ammo_use;\r
@@ -1603,7 +1605,7 @@ void W_ReloadedAndReady()
        // if we are inside the stomach, don't allow reloading, and schedule the weapon to reload once when we're out\r
        if(self.stat_eaten)\r
        {\r
-               self.clip_load = self.weapon_load[self.weapon] = -1;\r
+               self.clip_load = self.(weapon_load[self.weapon]) = -1;\r
                w_ready(); // don't keep executing each frame\r
                return;\r
        }\r
@@ -1623,7 +1625,7 @@ void W_ReloadedAndReady()
                        self.(self.current_ammo) -= 1;\r
                }\r
        }\r
-       self.weapon_load[self.weapon] = self.clip_load;\r
+       self.(weapon_load[self.weapon]) = self.clip_load;\r
 \r
        // do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon,\r
        // then quickly switch to another weapon and back. Reloading is canceled, but the reload delay is still there,\r
@@ -1715,5 +1717,5 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
        if(self.clip_load < 0)\r
                self.clip_load = 0;\r
        self.old_clip_load = self.clip_load;\r
-       self.clip_load = self.weapon_load[self.weapon] = -1;\r
+       self.clip_load = self.(weapon_load[self.weapon]) = -1;\r
 }
\ No newline at end of file