diff --git a/code/cgame/cg_weapons.c b/code/cgame/cg_weapons.c index 0ce33d0c..4dbe6d55 100644 --- a/code/cgame/cg_weapons.c +++ b/code/cgame/cg_weapons.c @@ -655,19 +655,16 @@ void CG_RegisterWeapon( int weaponNum ) { weaponInfo->ammoModel = trap_R_RegisterModel( ammo->world_model[0] ); } - strcpy( path, item->world_model[0] ); - COM_StripExtension(path, path, sizeof(path)); - strcat( path, "_flash.md3" ); + COM_StripExtension( item->world_model[0], path, sizeof(path) ); + Q_strcat( path, sizeof(path), "_flash.md3" ); weaponInfo->flashModel = trap_R_RegisterModel( path ); - strcpy( path, item->world_model[0] ); - COM_StripExtension(path, path, sizeof(path)); - strcat( path, "_barrel.md3" ); + COM_StripExtension( item->world_model[0], path, sizeof(path) ); + Q_strcat( path, sizeof(path), "_barrel.md3" ); weaponInfo->barrelModel = trap_R_RegisterModel( path ); - strcpy( path, item->world_model[0] ); - COM_StripExtension(path, path, sizeof(path)); - strcat( path, "_hand.md3" ); + COM_StripExtension( item->world_model[0], path, sizeof(path) ); + Q_strcat( path, sizeof(path), "_hand.md3" ); weaponInfo->handsModel = trap_R_RegisterModel( path ); if ( !weaponInfo->handsModel ) { diff --git a/code/q3_ui/ui_players.c b/code/q3_ui/ui_players.c index 7a04fb1c..d8794cbb 100644 --- a/code/q3_ui/ui_players.c +++ b/code/q3_ui/ui_players.c @@ -88,15 +88,13 @@ tryagain: } if ( weaponNum == WP_MACHINEGUN || weaponNum == WP_GAUNTLET || weaponNum == WP_BFG ) { - strcpy( path, item->world_model[0] ); - COM_StripExtension( path, path, sizeof(path) ); - strcat( path, "_barrel.md3" ); + COM_StripExtension( item->world_model[0], path, sizeof(path) ); + Q_strcat( path, sizeof(path), "_barrel.md3" ); pi->barrelModel = trap_R_RegisterModel( path ); } - strcpy( path, item->world_model[0] ); - COM_StripExtension( path, path, sizeof(path) ); - strcat( path, "_flash.md3" ); + COM_StripExtension( item->world_model[0], path, sizeof(path) ); + Q_strcat( path, sizeof(path), "_flash.md3" ); pi->flashModel = trap_R_RegisterModel( path ); switch( weaponNum ) { diff --git a/code/ui/ui_players.c b/code/ui/ui_players.c index 614cfb8d..53475d31 100644 --- a/code/ui/ui_players.c +++ b/code/ui/ui_players.c @@ -89,15 +89,13 @@ tryagain: } if ( weaponNum == WP_MACHINEGUN || weaponNum == WP_GAUNTLET || weaponNum == WP_BFG ) { - strcpy( path, item->world_model[0] ); - COM_StripExtension(path, path, sizeof(path)); - strcat( path, "_barrel.md3" ); + COM_StripExtension( item->world_model[0], path, sizeof(path) ); + Q_strcat( path, sizeof(path), "_barrel.md3" ); pi->barrelModel = trap_R_RegisterModel( path ); } - strcpy( path, item->world_model[0] ); - COM_StripExtension(path, path, sizeof(path)); - strcat( path, "_flash.md3" ); + COM_StripExtension( item->world_model[0], path, sizeof(path) ); + Q_strcat( path, sizeof(path), "_flash.md3" ); pi->flashModel = trap_R_RegisterModel( path ); switch( weaponNum ) {