diff --git a/source/src/hudgun.h b/source/src/hudgun.h index 54c8eaf5..47b5f286 100644 --- a/source/src/hudgun.h +++ b/source/src/hudgun.h @@ -115,7 +115,8 @@ void preload_hudguns() { loopi(NUMGUNS) { - defformatstring(path)("weapons/%s", guns[i].modelname); + defformatstring(widn)("modmdlweap%d", i); + defformatstring(path)("weapons/%s", identexists(widn)?getalias(widn):guns[i].modelname); loadmodel(path); } } diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 5e4f45fe..707d3c0a 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -491,7 +491,8 @@ void preload_playermodels() if(dynshadow && playermdl) playermdl->genshadows(8.0f, 4.0f); loopi(NUMGUNS) { - defformatstring(vwep)("weapons/%s/world", guns[i].modelname); + defformatstring(widn)("modmdlvwep%d", i); + defformatstring(vwep)("weapons/%s/world", identexists(widn)?getalias(widn):guns[i].modelname); model *vwepmdl = loadmodel(vwep); if(dynshadow && vwepmdl) vwepmdl->genshadows(8.0f, 4.0f); } @@ -709,7 +710,8 @@ void renderclient(playerent *d) } } string vwep; - if(d->weaponsel) formatstring(vwep)("weapons/%s/world", d->weaponsel->info.modelname); + defformatstring(widn)("modmdlvwep%d", d->weaponsel->type); + if(d->weaponsel) formatstring(vwep)("weapons/%s/world", identexists(widn)?getalias(widn):d->weaponsel->info.modelname); else vwep[0] = 0; renderclient(d, "playermodels", vwep[0] ? vwep : NULL, -(int)textureload(skin)->id); } diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 03fc84fe..77a17431 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -852,7 +852,8 @@ void weapon::renderhudmodel(int lastaction, int index) weaponmove wm; if(!intermission) wm.calcmove(unitv, lastaction, p); - defformatstring(path)("weapons/%s", info.modelname); + defformatstring(widn)("modmdlweap%d", type); + defformatstring(path)("weapons/%s", identexists(widn)?getalias(widn):info.modelname); bool emit = (wm.anim&ANIM_INDEX)==ANIM_GUN_SHOOT && (lastmillis - lastaction) < flashtime(); rendermodel(path, wm.anim|ANIM_DYNALLOC|(righthanded==index ? ANIM_MIRROR : 0)|(emit ? ANIM_PARTICLE : 0), 0, -1, wm.pos, p->yaw+90, p->pitch+wm.k_rot, 40.0f, wm.basetime, NULL, NULL, 1.28f); }