[HL25] Backport changes to CS bot place loading code
This commit is contained in:
parent
fd8a11b01b
commit
6d95ec7d03
1 changed files with 9 additions and 3 deletions
|
@ -139,7 +139,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// load the directory
|
/// load the directory
|
||||||
void Load( SteamFile *file )
|
bool Load( SteamFile *file )
|
||||||
{
|
{
|
||||||
// read number of entries
|
// read number of entries
|
||||||
EntryType count;
|
EntryType count;
|
||||||
|
@ -156,7 +156,7 @@ public:
|
||||||
if ( len >= sizeof( placeName ) )
|
if ( len >= sizeof( placeName ) )
|
||||||
{
|
{
|
||||||
assert( false && "PlaceDirectory::Load: Invalid placeName size" );
|
assert( false && "PlaceDirectory::Load: Invalid placeName size" );
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
file->Read( placeName, len );
|
file->Read( placeName, len );
|
||||||
|
@ -164,6 +164,8 @@ public:
|
||||||
|
|
||||||
AddPlace( TheBotPhrases->NameToID( placeName ) );
|
AddPlace( TheBotPhrases->NameToID( placeName ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1020,7 +1022,11 @@ NavErrorType LoadNavigationMap( void )
|
||||||
// load Place directory
|
// load Place directory
|
||||||
if (version >= 5)
|
if (version >= 5)
|
||||||
{
|
{
|
||||||
placeDirectory.Load( &navFile );
|
if ( !placeDirectory.Load( &navFile ) )
|
||||||
|
{
|
||||||
|
CONSOLE_ECHO( "ERROR: Invalid navigation file '%s'.\n", filename );
|
||||||
|
return NAV_INVALID_FILE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get number of areas
|
// get number of areas
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue