shotgun multiplayer gib fix + binaries (might require improvements)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6940 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2012-12-01 23:18:28 +00:00
parent 5ec00b2953
commit 283a2e6f8f
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -57,7 +57,7 @@ void processevent(client *c, shotevent &e)
case GUN_GRENADE: gs.grenades.add(e.id); break;
default:
{
int totalrays = 0, maxrays = e.gun==GUN_SHOTGUN ? SGMAXDMGABS: 1;
int totalrays = 0, maxrays = e.gun==GUN_SHOTGUN ? 3*SGRAYS: 1;
for(int i = 1; i<c->events.length() && c->events[i].type==GE_HIT; i++)
{
hitevent &h = c->events[i].hit;
@@ -65,14 +65,15 @@ void processevent(client *c, shotevent &e)
client *target = clients[h.target];
if(target->type==ST_EMPTY || target->state.state!=CS_ALIVE || h.lifesequence!=target->state.lifesequence) continue;
int rays = e.gun==GUN_SHOTGUN ? h.info : 1;
int rays = e.gun==GUN_SHOTGUN ? ((h.info & 0xFF00) >> 8) : 1;
if(rays<1) continue;
totalrays += rays;
if(totalrays>maxrays) continue;
int damage = rays*guns[e.gun].damage;
int damage = e.gun==GUN_SHOTGUN ? h.info&0xFF : rays*guns[e.gun].damage;
bool gib = false;
if(e.gun==GUN_KNIFE || (e.gun==GUN_SHOTGUN && rays==maxrays)) gib = true;
if(e.gun==GUN_KNIFE || (e.gun==GUN_SHOTGUN && rays == maxrays)) gib = true;
else if(e.gun==GUN_SNIPER) gib = h.info!=0;
if(e.gun==GUN_SNIPER && gib) damage *= 3;
serverdamage(target, c, damage, e.gun, gib, h.dir);
+1 -1
View File
@@ -681,7 +681,7 @@ void raydamage(vec &from, vec &to, playerent *d)
lastsgs_hits = numhits;
lastsgs_dmgt = dmgreal;
// conoutf("%d [%.3f%s] DMG with %d hits", lastsgs_dmgt, dmg4r, withBONUS ? "\fs\f3+\fr" : "", lastsgs_hits);
if(numhits) hitpush( dmgreal, o, d, from, to, d->weaponsel->type, lastsgs_hits == SGRAYS*3, dmgreal);
if(numhits) hitpush( dmgreal, o, d, from, to, d->weaponsel->type, lastsgs_hits == SGRAYS*3, dmgreal | (lastsgs_hits << 8));
// if(numhits) hitpush( dmgreal, o, d, from, to, d->weaponsel->type, dmgreal == SGMAXDMGABS, dmgreal);
if(d==player1) hitted = true;