diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 3084c62e..d78c6d77 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -336,23 +336,12 @@ void endmodelbatches(bool flush) } VAR(dbgmbatch, 0, 0, 1); -VARP(playerisrighthanded, 0, 1, 1); // flowtron 20090727 void rendermodel(const char *mdl, int anim, int tex, float rad, const vec &o, float yaw, float pitch, float speed, int basetime, playerent *d, modelattach *a, float scale) { model *m = loadmodel(mdl); if(!m || (stenciling && (m->shadowdist <= 0 || anim&ANIM_TRANSLUCENT))) return; - if(playerisrighthanded == 0) // flowtron 20090727 - { - bool isagun = ((anim&ANIM_GUN_IDLE) || (anim&ANIM_GUN_RELOAD) || (anim&ANIM_GUN_SHOOT) || (anim&ANIM_GUN_THROW)); - if(isagun) - { - if(anim&ANIM_MIRROR) anim &= ~ANIM_MIRROR; - else anim |= ANIM_MIRROR; - } - } - if(rad >= 0) { if(!rad) rad = m->radius; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 4c89538f..c72adb43 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -632,6 +632,8 @@ void weapon::attackphysics(vec &from, vec &to) // physical fx to the owner } } +VARP(righthanded, 0, 1, 1); // flowtron 20090727 + void weapon::renderhudmodel(int lastaction, int index) { vec unitv; @@ -642,7 +644,8 @@ void weapon::renderhudmodel(int lastaction, int index) if(!intermission) wm.calcmove(unitv, lastaction); s_sprintfd(path)("weapons/%s", info.modelname); bool emit = (wm.anim&ANIM_INDEX)==ANIM_GUN_SHOOT && (lastmillis - lastaction) < flashtime(); - rendermodel(path, wm.anim|ANIM_DYNALLOC|(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); + 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); } void weapon::updatetimers()