*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@823 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2007-01-16 02:03:54 +00:00
parent f5f0c7909b
commit 9e6147ebfe
6 changed files with 15 additions and 16 deletions
+7 -4
View File
@@ -463,6 +463,9 @@ void shorten(vec &from, vec &to, vec &target)
target.sub(from).normalize().mul(from.dist(to)).add(from);
};
const float HEADSIZE = 0.8f;
vec hitpos;
void raydamage(vec &from, vec &to, playerent *d)
{
int i = -1, gdam = guns[d->gunselect].damage;
@@ -495,10 +498,10 @@ void raydamage(vec &from, vec &to, playerent *d)
}
else if((o = intersectclosest(from, to, i, d)))
{
playerent head = *o; // check headshot
head.eyeheight = head.aboveeye/4;
head.radius = 2;
if(d->gunselect == GUN_SNIPER && intersect(&head, from, to)) gdam = guns[d->gunselect].damage * 3;
if(d==player1 && d->gunselect==GUN_SNIPER
&& worldpos!=hitpos && hitpos.z>=o->o.z+o->aboveeye-HEADSIZE
&& intersect(o, from, hitpos))
gdam *= 3;
hitpush(i, gdam, o, d, from, to);
shorten(from, o->o, to);