From c1c5b2d0b0c1391d8d0023c9ca611c10c7badef2 Mon Sep 17 00:00:00 2001 From: sireus Date: Thu, 6 Dec 2012 18:12:49 +0000 Subject: [PATCH] fixed akimbo hudgun animation for non-local players git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6950 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/weapon.cpp | 18 +++++++----------- source/src/weapon.h | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 0e09bf06..952df4bc 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -683,7 +683,7 @@ void raydamage(vec &from, vec &to, playerent *d) // 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 | (lastsgs_hits << 8)); // if(numhits) hitpush( dmgreal, o, d, from, to, d->weaponsel->type, dmgreal == SGMAXDMGABS, dmgreal); - + if(d==player1) hitted = true; hitscount+=numhits; } @@ -704,7 +704,7 @@ void raydamage(vec &from, vec &to, playerent *d) shorten(from, to, dist); hitscount++; } - + if(d==player1) { if(!rayscount) rayscount = 1; @@ -1300,7 +1300,7 @@ bool shotgun::attack(vec &targ) void shotgun::attackfx(const vec &from, const vec &to, int millis) { loopi(SGRAYS) particle_splash(PART_SPARK, 5, 200, sgr[i].rv); - + if(addbullethole(owner, from, to)) { loopk(3) @@ -1516,15 +1516,11 @@ akimbo::akimbo(playerent *owner) : gun(owner, GUN_AKIMBO), akimboside(0), akimbo akimbolastaction[0] = akimbolastaction[1] = 0; } -bool akimbo::attack(vec &targ) +void akimbo::attackfx(const vec &from, const vec &to, int millis) { - if(gun::attack(targ)) - { - akimbolastaction[akimboside] = owner->lastaction; - akimboside = (akimboside+1)%2; - return true; - } - return false; + akimbolastaction[akimboside] = owner->lastaction; + akimboside = (akimboside+1)%2; + gun::attackfx(from, to, millis); } void akimbo::onammopicked() diff --git a/source/src/weapon.h b/source/src/weapon.h index 9de6771e..fedbee42 100644 --- a/source/src/weapon.h +++ b/source/src/weapon.h @@ -170,7 +170,7 @@ struct akimbo : gun int akimbomillis; int akimbolastaction[2]; - bool attack(vec &targ); + void attackfx(const vec &from, const vec &to, int millis); void onammopicked(); void onselecting(); bool selectable();