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
|
|
|
|
2019-01-21 02:00:14 +00:00
|
|
|
void View_UpdateWeapon(entity vm, entity mflash)
|
2018-12-31 01:00:38 +00:00
|
|
|
{
|
2019-01-21 02:00:14 +00:00
|
|
|
int aw = getstati( STAT_ACTIVEWEAPON );
|
|
|
|
if( aw < CS_WEAPON_COUNT ) {
|
2017-11-16 22:53:02 +00:00
|
|
|
if ( pSeat->fLastWeapon != aw ) {
|
|
|
|
pSeat->fLastWeapon = aw;
|
|
|
|
if ( aw >= 1 ) {
|
2018-12-31 01:00:38 +00:00
|
|
|
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 ]);
|
|
|
|
}
|
2019-01-21 02:00:14 +00:00
|
|
|
setmodel( vm, wm );
|
2019-01-14 15:13:20 +00:00
|
|
|
|
|
|
|
if (getstati_punf(STAT_TEAM) == TEAM_CT) {
|
2019-01-21 02:00:14 +00:00
|
|
|
setcustomskin(vm, "", "geomset 0 2\n");
|
2019-01-14 15:13:20 +00:00
|
|
|
} else {
|
2019-01-21 02:00:14 +00:00
|
|
|
setcustomskin(vm, "", "geomset 0 1\n");
|
2019-01-14 15:13:20 +00:00
|
|
|
}
|
|
|
|
|
2019-01-21 02:00:14 +00:00
|
|
|
skel_delete( mflash.skeletonindex );
|
|
|
|
mflash.skeletonindex = skel_create( vm.modelindex );
|
|
|
|
pSeat->fNumBones = skel_get_numbones( mflash.skeletonindex ) + 1;
|
2017-11-20 17:16:42 +00:00
|
|
|
pSeat->fEjectBone = pSeat->fNumBones + 1;
|
2017-01-14 15:00:31 +00:00
|
|
|
}
|
2017-01-12 02:49:59 +00:00
|
|
|
}
|
2017-07-02 20:49:22 +00:00
|
|
|
}
|
2016-12-01 17:50:48 +00:00
|
|
|
}
|