From 9ef2e3e3f915f16da1037e4f8ab640cee6428c11 Mon Sep 17 00:00:00 2001 From: flowtron Date: Tue, 18 Jan 2011 06:02:21 +0000 Subject: [PATCH] minor weaponry fixes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6025 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/serverevents.h | 2 +- source/src/weapon.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/source/src/serverevents.h b/source/src/serverevents.h index faa48ac3..f53a4499 100644 --- a/source/src/serverevents.h +++ b/source/src/serverevents.h @@ -51,7 +51,7 @@ void processevent(client *c, shotevent &e) // int(e.from[0]*DMF), int(e.from[1]*DMF), int(e.from[2]*DMF), int(e.to[0]*DMF), int(e.to[1]*DMF), int(e.to[2]*DMF), c->clientnum); - gs.shotdamage += guns[e.gun].damage*(e.gun==GUN_SHOTGUN ? SGRAYS : 1); + gs.shotdamage += guns[e.gun].damage*(e.gun==GUN_SHOTGUN ? SGMAXDMGLOC : 1); // 2011jan17:ft: so accuracy stays correct, since SNIPER:headshot also "exceeds expectations" we use SGMAXDMGLOC instead of SGMAXDMGABS! switch(e.gun) { case GUN_GRENADE: gs.grenades.add(e.id); break; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 8cbb368c..3f0c9a28 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -627,7 +627,7 @@ void raydamage(vec &from, vec &to, playerent *d) dmgrealt += (SGMAXDMGABS-SGMAXDMGLOC); dmgrealt = min(dmgrealt, SGMAXDMGABS); // maximum damage of the shotgun } - if(hitrays) hitpush( dmgrealt, o, d, from, to, d->weaponsel->type, hitrays == SGMAXDMGABS, dmgrealt); + if(hitrays) hitpush( dmgrealt, o, d, from, to, d->weaponsel->type, dmgrealt == SGMAXDMGABS, dmgrealt); if(d==player1 && hitrays) hitted=true; if(!raysleft) break; } @@ -1134,7 +1134,6 @@ gun::gun(playerent *owner, int type) : weapon(owner, type) {} bool gun::attack(vec &targ) { - if(1==0)conoutf("gun::attack(%.2f, %.2f, %.2f)", targ.x, targ.y, targ.z);//DEBUG 2010nov19 int attackmillis = lastmillis-owner->lastaction; if(timebalance < gunwait) attackmillis += timebalance; if(attackmillislastaction; if(attackmillisattack(targ); loopi(NUMGUNS) { - weapon *bweap = player1->weapons[i]; + weapon *bweap = p->weapons[i]; if(bweap != weap && bweap->busy()) bweap->attack(targ); } }