X-Git-Url: https://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_weaponsystem.qc;h=66ad0f7c587fbef72ec9719f56f0d481bc88a85e;hp=e8f7fcd7b79fb94006813fd97f8cea86586e07dd;hb=0b1e581725b0ca18a2e2a7b4b7ea30b960d2c8a3;hpb=8d9631d12af666b7d34817f59c30506e8bae7b65 diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index e8f7fcd7..66ad0f7c 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -255,18 +255,17 @@ float CL_ExteriorWeaponentity_CustomizeEntityForClient() // otherwise, the stomach model the predator is transformed in (see Client_customizeentityforclient) will have a weapon model attached to it if(self.owner.weaponname == "" || self.owner.deadflag != DEAD_NO) return TRUE; - if(other.cvar_chase_active > 0 || other.classname == "observer") // the classname check prevents a bug - { - setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3")); - return TRUE; - } + if(other.spectatee_status) other = other.enemy; // also do this for the player we are spectating + + if not(other.cvar_chase_active || other.classname == "observer") // the observer check prevents a bug if(other.predator == self.owner || other.fakepredator == self.owner) { setmodel(self, ""); return TRUE; } + setmodel(self, strcat("models/weapons/v_", self.owner.weaponname, ".md3")); return TRUE; } @@ -738,6 +737,14 @@ void CL_Weaponentity_Think() } // create or update the lasertarget entity + + // if we are a micro or macro, size the weapon model accordingly + if(self.owner.scale && cvar("g_healthsize_weapon_scalefactor")) + if(self.model != "") + { + self.weaponentity.scale = (1 + cvar("g_healthsize_weapon_scalefactor")) - cvar("g_healthsize_weapon_scalefactor") * self.owner.scale; + self.weaponentity.origin_z = (1 - self.weaponentity.scale) * cvar("g_healthsize_weapon_scalefactor_pos"); + } }; void CL_ExteriorWeaponentity_Think() @@ -820,6 +827,14 @@ void CL_ExteriorWeaponentity_Think() self.angles = ang; } + // if we are a micro or macro, size the weapon model accordingly + if(self.owner.scale && cvar("g_healthsize_exteriorweapon_scalefactor")) + if(self.model != "") + { + self.scale = 1 / self.owner.scale; // for some reason, the exterior weapon entity copies the player's scale somewhere else, so undo that first + self.scale = (1 - cvar("g_healthsize_exteriorweapon_scalefactor")) + cvar("g_healthsize_exteriorweapon_scalefactor") * self.scale; + } + self.colormap = self.owner.colormap; self.customizeentityforclient = CL_ExteriorWeaponentity_CustomizeEntityForClient; }; @@ -1569,6 +1584,14 @@ void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload) void W_ReloadedAndReady() { + // if we are inside the stomach, don't allow reloading, and schedule the weapon to reload once when we're out + if(self.predator.classname == "player") + { + self.clip_load = self.weapon_load[self.weapon] = -1; + w_ready(); // don't keep executing each frame + return; + } + // finish the reloading process, and do the ammo transfer self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading @@ -1597,6 +1620,10 @@ void W_ReloadedAndReady() void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, string sent_sound) { + // if we are inside the stomach, don't allow reloading + if(self.predator.classname == "player") + return; + // set global values to work with self.reload_ammo_min = sent_ammo_min; self.reload_ammo_amount = sent_ammo_amount;