mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-23 20:52:54 +00:00
Make barrel/flash model name buffer safe
This commit is contained in:
parent
af617bc0e6
commit
af8acbd7a9
3 changed files with 14 additions and 21 deletions
|
@ -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 ) {
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue