*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@824 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2007-01-16 02:42:28 +00:00
parent 9e6147ebfe
commit d993d54f8e
+9 -4
View File
@@ -449,9 +449,9 @@ void shootv(int gun, vec &from, vec &to, playerent *d, bool local, int nademilli
};
};
void hitpush(int target, int damage, playerent *d, playerent *at, vec &from, vec &to)
void hitpush(int target, int damage, playerent *d, playerent *at, vec &from, vec &to, bool gib = false)
{
hit(target, damage, d, at, at->gunselect==GUN_KNIFE ? true : false);
hit(target, damage, d, at, gib);
vec v;
float dist = to.dist(from, v);
v.mul(damage/dist/50);
@@ -498,12 +498,17 @@ void raydamage(vec &from, vec &to, playerent *d)
}
else if((o = intersectclosest(from, to, i, d)))
{
if(d==player1 && d->gunselect==GUN_SNIPER
bool gib = false;
if(d->gunselect==GUN_KNIFE) gib = true;
else if(d==player1 && d->gunselect==GUN_SNIPER
&& worldpos!=hitpos && hitpos.z>=o->o.z+o->aboveeye-HEADSIZE
&& intersect(o, from, hitpos))
{
gdam *= 3;
gib = true;
};
hitpush(i, gdam, o, d, from, to);
hitpush(i, gdam, o, d, from, to, gib);
shorten(from, o->o, to);
};
};