diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index bbcab0ef..8f3888e9 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -667,8 +667,7 @@ void weapon::renderhudmodel(int lastaction, int index) if(!intermission) wm.calcmove(unitv, lastaction); defformatstring(path)("weapons/%s", info.modelname); bool emit = (wm.anim&ANIM_INDEX)==ANIM_GUN_SHOOT && (lastmillis - lastaction) < flashtime(); - int rindex = (righthanded) ? index : (index ? 0 : 1); - rendermodel(path, wm.anim|ANIM_DYNALLOC|(rindex ? ANIM_MIRROR : 0)|(emit ? ANIM_PARTICLE : 0), 0, -1, wm.pos, player1->yaw+90, player1->pitch+wm.k_rot, 40.0f, wm.basetime, NULL, NULL, 1.28f); + rendermodel(path, wm.anim|ANIM_DYNALLOC|(righthanded==index ? ANIM_MIRROR : 0)|(emit ? ANIM_PARTICLE : 0), 0, -1, wm.pos, player1->yaw+90, player1->pitch+wm.k_rot, 40.0f, wm.basetime, NULL, NULL, 1.28f); } void weapon::updatetimers() @@ -1125,7 +1124,7 @@ bool pistol::selectable() { return weapon::selectable() && !m_nopistol; } // akimbo -akimbo::akimbo(playerent *owner) : gun(owner, GUN_AKIMBO), akimbomillis(0) +akimbo::akimbo(playerent *owner) : gun(owner, GUN_AKIMBO), akimboside(0), akimbomillis(0) { akimbolastaction[0] = akimbolastaction[1] = 0; } @@ -1134,8 +1133,8 @@ bool akimbo::attack(vec &targ) { if(gun::attack(targ)) { - akimbolastaction[akimboside?1:0] = lastmillis; - akimboside = !akimboside; + akimbolastaction[akimboside] = lastmillis; + akimboside = (akimboside+1)%2; return true; } return false; @@ -1159,7 +1158,7 @@ void akimbo::onselecting() bool akimbo::selectable() { return weapon::selectable() && !m_nopistol && owner->akimbo; } void akimbo::updatetimers() { weapon::updatetimers(); /*loopi(2) akimbolastaction[i] = lastmillis;*/ } -void akimbo::reset() { akimbolastaction[0] = akimbolastaction[1] = akimbomillis = 0; akimboside = false; } +void akimbo::reset() { akimbolastaction[0] = akimbolastaction[1] = akimbomillis = akimboside = 0; } void akimbo::renderhudmodel() { diff --git a/source/src/weapon.h b/source/src/weapon.h index 2365ada4..0197850b 100644 --- a/source/src/weapon.h +++ b/source/src/weapon.h @@ -147,7 +147,7 @@ struct akimbo : gun { akimbo(playerent *owner); - bool akimboside; + int akimboside; int akimbomillis; int akimbolastaction[2]; diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index 8408ac6d..2142c7aa 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -518,18 +518,6 @@ bool load_world(char *mname) // still supports all map formats that have char texuse[256]; loopi(256) texuse[i] = 0; sqr *t = NULL; - int bbx[2],bby[2],bbz[2]; - for(int cbba = 0; cbba < 3; cbba++) - { - for(int bx = 0; bx < 2; bx++) switch(cbba) - { - case 1: bbx[bx] = 0; break; - case 2: bby[bx] = 0; break; - case 3: bbz[bx] = 0; break; - default: break; - } - - } loopk(cubicsize) { sqr *s = &world[k];