diff --git a/source/src/serverevents.h b/source/src/serverevents.h index c13f18e3..16d1c223 100644 --- a/source/src/serverevents.h +++ b/source/src/serverevents.h @@ -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; ievents.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); diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index ffcbc568..0e09bf06 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -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;