diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index deadcad0..09cb1f27 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -422,7 +422,7 @@ void showteamkill() { player1->lastteamkill = lastmillis; } // damage arriving from the network, monsters, yourself, all ends up here. -void selfdamage(int damage, int actor, playerent *act, bool gib, playerent *pl) +void dodamage(int damage, int actor, playerent *act, bool gib, playerent *pl) { if(!act) return; if(pl->state!=CS_ALIVE || editmode || intermission) return; @@ -596,7 +596,7 @@ COMMANDN(map, changemap, ARG_1STR); void suicide() { if(player1->state==CS_DEAD) return; - selfdamage(1000, -1, player1); + dodamage(1000, -1, player1); demodamage(1000, player1->o); } diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index aa59a767..4c5a5ba1 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -244,7 +244,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p) int target = getint(p); int damage = getint(p); int ls = getint(p); - if(target==getclientnum()) { if(ls==player1->lifesequence) selfdamage(damage, cn, d, gib); } + if(target==getclientnum()) { if(ls==player1->lifesequence) dodamage(damage, cn, d, gib); } else { playerent *victim = getclient(target); diff --git a/source/src/protos.h b/source/src/protos.h index 2b18702f..778d2e0a 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -111,7 +111,7 @@ extern void changemap(char *name); extern void initclient(); extern void deathstate(playerent *pl); extern void spawnplayer(playerent *d); -extern void selfdamage(int damage, int actor, playerent *act, bool gib = false, playerent *pl = player1); +extern void dodamage(int damage, int actor, playerent *act, bool gib = false, playerent *pl = player1); extern playerent *newplayerent(); extern botent *newbotent(); extern void freebotent(botent *d); diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index c9eb53f3..2822825f 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -115,13 +115,16 @@ void rendermodel(char *mdl, int anim, int tex, float rad, float x, float y, floa light.y = s->g/ll+of; light.z = s->b/ll+of; - if(dynshadow && m->hasshadows() && (!d || (anim&ANIM_INDEX)!=ANIM_LYING_DEAD)) + if(dynshadow && m->hasshadows()) { vec center(x, z, s->floor); if(s->type==FHF) center.z -= s->vdelta/4.0f; - center.z += 0.1f; - glColor4f(1, 1, 1, dynshadow/100.0f); - m->rendershadow(anim, varseed, speed, basetime, center, yaw, vwep); + if(center.z-0.1f<=y) + { + center.z += 0.1f; + glColor4f(1, 1, 1, dynshadow/100.0f); + m->rendershadow(anim, varseed, speed, basetime, center, yaw, vwep); + } } } diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 6e1a3d28..c6185cc3 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -243,7 +243,7 @@ void newprojectile(vec &from, vec &to, float speed, bool local, playerent *owner void hit(int target, int damage, playerent *d, playerent *at, bool gib=false) { d->lastpain = lastmillis; - if(d==player1 || d->type==ENT_BOT) selfdamage(damage, -1, at, gib, d); + if(d==player1 || d->type==ENT_BOT) dodamage(damage, -1, at, gib, d); else { addmsg(gib ? SV_GIBDAMAGE : SV_DAMAGE, "ri3", target, damage, d->lifesequence);