X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_player.qc;h=54cd85ba555cc4bcbd93e0f503c46682df4ad3c9;hb=8f4d064a1d62a040e788fc0634baf93e888ba2f6;hp=0b1576eed152897ae80855fc9ad79b82da313451;hpb=1063af9f08612927b63f9835f33d09b3b45e7063;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 0b1576eed..54cd85ba5 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -124,6 +124,22 @@ void WeaponStats_LogKill(float awep, float abot, float vwep, float vbot) .entity pusher; .float pushltime; +.float CopyBody_nextthink; +.void(void) CopyBody_think; +void CopyBody_Think(void) +{ + if(self.CopyBody_nextthink && time > self.CopyBody_nextthink) + { + self.CopyBody_think(); + if(wasfreed(self)) + return; + self.CopyBody_nextthink = self.nextthink; + self.CopyBody_think = self.think; + self.think = CopyBody_Think; + } + CSQCMODEL_AUTOUPDATE(); + self.nextthink = time; +} void CopyBody(float keepvelocity) { entity oldself; @@ -161,11 +177,9 @@ void CopyBody(float keepvelocity) self.skin = oldself.skin; self.species = oldself.species; self.movetype = oldself.movetype; - self.nextthink = oldself.nextthink; self.solid = oldself.solid; self.ballistics_density = oldself.ballistics_density; self.takedamage = oldself.takedamage; - self.think = oldself.think; self.customizeentityforclient = oldself.customizeentityforclient; self.uncustomizeentityforclient = oldself.uncustomizeentityforclient; self.uncustomizeentityforclient_set = oldself.uncustomizeentityforclient_set; @@ -185,6 +199,12 @@ void CopyBody(float keepvelocity) if(self.colormap <= maxclients && self.colormap > 0) self.colormap = 1024 + self.clientcolors; + CSQCMODEL_AUTOINIT(); + self.CopyBody_nextthink = oldself.nextthink; + self.CopyBody_think = oldself.think; + self.nextthink = time; + self.think = CopyBody_Think; + self = oldself; } @@ -225,14 +245,14 @@ void player_setupanimsformodel() self.anim_forwardleft = animfixfps(self, '20 1 1'); self.anim_backright = animfixfps(self, '21 1 1'); self.anim_backleft = animfixfps(self, '22 1 1'); - self.anim_melee = animfixfps2(self, '23 1 1', '11 1 5'); - self.anim_duckwalkbackwards = animfixfps2(self, '24 1 1', '4 1 1'); - self.anim_duckwalkstrafeleft = animfixfps2(self, '25 1 1', '4 1 1'); - self.anim_duckwalkstraferight = animfixfps2(self, '26 1 1', '4 1 1'); - self.anim_duckwalkforwardright = animfixfps2(self, '27 1 1', '4 1 1'); - self.anim_duckwalkforwardleft = animfixfps2(self, '28 1 1', '4 1 1'); - self.anim_duckwalkbackright = animfixfps2(self, '29 1 1', '4 1 1'); - self.anim_duckwalkbackleft = animfixfps2(self, '30 1 1', '4 1 1'); + self.anim_melee = animfixfps(self, '23 1 1'); + self.anim_duckwalkbackwards = animfixfps(self, '24 1 1'); + self.anim_duckwalkstrafeleft = animfixfps(self, '25 1 1'); + self.anim_duckwalkstraferight = animfixfps(self, '26 1 1'); + self.anim_duckwalkforwardright = animfixfps(self, '27 1 1'); + self.anim_duckwalkforwardleft = animfixfps(self, '28 1 1'); + self.anim_duckwalkbackright = animfixfps(self, '29 1 1'); + self.anim_duckwalkbackleft = animfixfps(self, '30 1 1'); // TODO introspect models for finding right "fps" value (1/duration) // reset animstate now setanim(self, self.anim_idle, TRUE, FALSE, TRUE); @@ -400,7 +420,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 <= -autocvar_sv_gibhealth && self.modelindex != 0) + if (self.health <= -autocvar_sv_gibhealth && !(self.effects & CSQCMODEL_EF_INVISIBLE)) { // don't use any animations as a gib self.frame = 0; @@ -409,7 +429,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float self.view_ofs = '0 0 4'; Violence_GibSplash(self, 1, 1, attacker); - self.modelindex = 0; // restore later + self.effects |= CSQCMODEL_EF_INVISIBLE; self.solid = SOLID_NOT; // restore later } } @@ -663,8 +683,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht float w; w = DEATH_WEAPONOF(deathtype); if(WEP_VALID(w)) - if(self.classname == "player") - if(self != attacker) + if(accuracy_isgooddamage(attacker, self)) attacker.accuracy.(accuracy_frags[w-1]) += 1; if(deathtype == DEATH_HURTTRIGGER && g_freezetag) @@ -692,8 +711,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht else DropFlag(self.flagcarried, world, attacker); } - if(self.ballcarried && g_nexball) - DropBall(self.ballcarried, self.origin, self.velocity); Portal_ClearAllLater(self); if(clienttype(self) == CLIENTTYPE_REAL)