From fdfc4f435865cc0ab61de8de1e5a156d0e1b720e Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 7 Aug 2007 16:48:37 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1209 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 5 ++--- source/src/clients2c.cpp | 2 +- source/src/menus.cpp | 3 --- source/src/rendermodel.cpp | 14 ++++++++++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index d2174c43..58ab59a3 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -130,7 +130,7 @@ extern void thrownade(playerent *d, const vec &vel, bounceent *p); void deathstate(playerent *pl) { - pl->lastaction = lastmillis; + pl->lastpain = lastmillis; pl->attacking = false; pl->state = CS_DEAD; pl->pitch = 0; @@ -146,7 +146,6 @@ void deathstate(playerent *pl) void spawnstate(playerent *d) // reset player state not persistent accross spawns { d->respawn(); - //d->lastaction = lastmillis; if(d==player1) { gun_changed = true; @@ -308,7 +307,7 @@ void updateworld(int curtime, int lastmillis) // main game update loop //put game mode extra call here if(player1->state==CS_DEAD) { - if(lastmillis-player1->lastaction<2000) + if(lastmillis-player1->lastpain<2000) { player1->move = player1->strafe = 0; moveplayer(player1, 10, false); diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 70d606cb..c1b62580 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -89,7 +89,7 @@ void parsepositions(ucharbuf &p) d->onfloor = f&1; f >>= 1; int oldstate = d->state, state = f&7; - if(state==CS_DEAD && oldstate!=CS_DEAD) d->lastaction = lastmillis; + if(state==CS_DEAD && oldstate!=CS_DEAD) d->lastpain = lastmillis; d->state = state; f >>= 3; d->onladder = f&1; diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 0faee37e..2baedcb9 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -146,9 +146,6 @@ void rendermenumdl() glPushMatrix (); - float t = (lastmillis-player1->lastaction)/1000.0f; - if(t >= 1.6f) t = 1.6f; - glLoadIdentity(); glRotatef(90+180, 0, -1, 0); glRotatef(90, -1, 0, 0); diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 2c0f6a94..a21739e7 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -105,7 +105,13 @@ void rendermodel(char *mdl, int anim, int tex, float rad, float x, float y, floa int ix = (int)x; int iy = (int)y; vec light(1, 1, 1); - int varseed = (int)(size_t)d + (d ? d->lastaction : 0); + int varseed = 0; + if(d) switch(anim&ANIM_INDEX) + { + case ANIM_DEATH: + case ANIM_LYING_DEAD: varseed = (int)(size_t)d + d->lastpain; break; + default: varseed = (int)(size_t)d + d->lastaction; break; + } model *vwep = NULL; if(vwepmdl) @@ -225,9 +231,9 @@ void renderclient(playerent *d, char *mdlname, char *vwepname, int tex) d->pitch = 0.1f; int r = 6; anim = ANIM_DEATH; - varseed += d->lastaction; - basetime = d->lastaction; - int t = lastmillis-d->lastaction; + varseed += d->lastpain; + basetime = d->lastpain; + int t = lastmillis-d->lastpain; if(t<0 || t>20000) return; if(t>(r-1)*100-50) {