X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_player.qc;h=e282ed37e836a32238750c3469e776cd4bc29306;hb=9109dc44350b48e3924e7749634f30b188a7de4a;hp=ea3a9797194c58fe35f0bb1f2ac7d886176a6631;hpb=405055c8b7a511f99c34e34aa0da3964cc04de48;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index ea3a9797..e282ed37 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -218,6 +218,10 @@ float player_getspecies() void player_setupanimsformodel() { + // if this is the stomach model (or any model that can't be animated), don't attempt to animate + //if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension + // return; + local string animfilename; local float animfile; // defaults for legacy .zym models without animinfo files @@ -245,7 +249,7 @@ void player_setupanimsformodel() self.anim_backright = '21 1 1'; self.anim_backleft = '22 1 1'; animparseerror = FALSE; - animfilename = strcat(self.model, ".animinfo"); + animfilename = strcat(self.playermodel, ".animinfo"); // only the normal player model may contain animation info animfile = fopen(animfilename, FILE_READ); if (animfile >= 0) { @@ -282,16 +286,16 @@ void player_setupanimsformodel() else dprint("File ", animfilename, " not found, assuming legacy .zym model animation timings\n"); - // the line below is disabled due to issues with the stomach model, which cannot be animated. - // customizeentityforclient cannot let this part of the code know whether it's the stomach model or normal - // player model we're using. Attempting to animate the stomach model causes BIG issues, and must not be allowed. - // reset animstate now - //setanim(self, self.anim_idle, TRUE, FALSE, TRUE); + setanim(self, self.anim_idle, TRUE, FALSE, TRUE); }; void player_anim (void) { + // if this is the stomach model (or any model that can't be animated), don't attempt to animate + //if(substring(self.model, strlen(self.model) - 3, 3) == "md3") // check model extension + // return; + updateanim(self); if (self.weaponentity) updateanim(self.weaponentity); @@ -357,9 +361,9 @@ void player_anim (void) setanim(self.weaponentity, self.weaponentity.anim_idle, TRUE, FALSE, FALSE); } -void SpawnThrownWeapon (vector org, float w) +void SpawnThrownWeapon (vector org, float w, float doreduce) { - W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, FALSE); + W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, doreduce); } void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) @@ -402,7 +406,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float self.dmg_take = self.dmg_take + take;//max(take - 10, 0); self.dmg_inflictor = inflictor; - if (self.health <= -75 && self.modelindex != 0) + if (self.health <= -cvar("sv_gibhealth") && self.modelindex != 0) { // don't use any animations as a gib self.frame = 0; @@ -593,7 +597,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht // clear selected player display ClearSelectedPlayer(); // throw a weapon - SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon); + SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon, FALSE); // print an obituary message Obituary (attacker, inflictor, self, deathtype); race_PreDie(); @@ -745,7 +749,6 @@ void ClearSelectedPlayer() } } -.float dropweapon_check; void UpdateSelectedPlayer() { entity selected; @@ -758,7 +761,7 @@ void UpdateSelectedPlayer() if(!self.dropweapon_check) if(self.predator.team != self.team) // don't disarm team mates when swallowing them if(random() < cvar("g_balance_vore_swallow_dropweapon")) - SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon); + SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon, TRUE); self.dropweapon_check = TRUE; } else @@ -1211,8 +1214,6 @@ void UpdatePlayerSounds() LoadPlayerSounds(strcat(self.model, ".sounds"), 0); } -.float soundtimefilter; -.entity soundownerfilter; void GlobalSound(string sample, float chan, float voicetype) { float n; @@ -1295,25 +1296,16 @@ void GlobalSound(string sample, float chan, float voicetype) break; tauntrand = random(); FOR_EACH_REALCLIENT(msg_entity) - { - msg_entity.soundownerfilter = self; if (tauntrand < msg_entity.cvar_cl_autotaunt) - if not (self.taunt_soundtimefiltered && msg_entity.soundownerfilter.soundtimefilter > time) + if (msg_entity.cvar_cl_voice_directional >= 1) { - if (msg_entity.cvar_cl_voice_directional >= 1) - { - if(self.predator.classname == "player") - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); - else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); - } + if(self.predator.classname == "player") + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); else - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); - - if(self.taunt_soundtimefiltered) - msg_entity.soundownerfilter.soundtimefilter = time + msg_entity.cvar_cl_autotaunt_repeat; + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); } - } + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); break; case VOICETYPE_TAUNT: if(self.classname == "player")