nuclide/Source/client/cstrike/view.c

38 lines
995 B
C
Raw Normal View History

2019-01-16 20:18:28 +00:00
/***
*
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
*
* See the file LICENSE attached with the sources for usage details.
*
****/
2016-12-01 17:50:48 +00:00
void View_UpdateWeapon(entity vm, entity mflash)
{
int aw = getstati( STAT_ACTIVEWEAPON );
if( aw < CS_WEAPON_COUNT ) {
if ( pSeat->fLastWeapon != aw ) {
pSeat->fLastWeapon = aw;
if ( aw >= 1 ) {
string wm;
if (autocvar_skins_dir != "") {
wm = sprintf("skins/%s/%s", autocvar_skins_dir, sViewModels[ aw - 1 ]);
} else {
wm = sprintf("models/%s", sViewModels[ aw - 1 ]);
}
setmodel( vm, wm );
if (getstati_punf(STAT_TEAM) == TEAM_CT) {
setcustomskin(vm, "", "geomset 0 2\n");
} else {
setcustomskin(vm, "", "geomset 0 1\n");
}
skel_delete( mflash.skeletonindex );
mflash.skeletonindex = skel_create( vm.modelindex );
pSeat->fNumBones = skel_get_numbones( mflash.skeletonindex ) + 1;
pSeat->fEjectBone = pSeat->fNumBones + 1;
}
}
}
2016-12-01 17:50:48 +00:00
}