Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sp/src/game/client/weapons_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ void WeaponsResource::LoadWeaponSprites( WEAPON_FILE_INFO_HANDLE hWeaponFileInfo
pWeaponInfo->iconSmall = NULL;

char sz[128];

#ifdef MAPBASE
if ( pWeaponInfo->bCustom )
{
// Load the map-specific script instead
extern const char *g_MapName;
Q_snprintf( sz, sizeof( sz ), "maps/%s_%s", g_MapName, pWeaponInfo->szClassName );
}
else
#endif
Q_snprintf(sz, sizeof( sz ), "scripts/%s", pWeaponInfo->szClassName);

CUtlDict< CHudTexture *, int > tempList;
Expand Down
5 changes: 5 additions & 0 deletions sp/src/game/shared/weapon_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ bool ReadWeaponDataFromFileForSlot( IFileSystem* filesystem, const char *szWeapo
return false;

#ifdef MAPBASE
// Reload HUD elements if we had a custom script
if ( pFileInfo->bCustom )
pFileInfo->bLoadedHudElements = false;

pFileInfo->bCustom = false;
#endif
pFileInfo->Parse( pKV, szWeaponName );
Expand Down Expand Up @@ -349,6 +353,7 @@ bool ReadCustomWeaponDataFromFileForSlot( IFileSystem* filesystem, const char *s
return false;

pFileInfo->bCustom = true;
pFileInfo->bLoadedHudElements = false;
pFileInfo->Parse( pKV, szWeaponName );

pKV->deleteThis();
Expand Down
Loading