diff --git a/game_shared/bot/nav_file.cpp b/game_shared/bot/nav_file.cpp index 5e47ee5..67971d4 100644 --- a/game_shared/bot/nav_file.cpp +++ b/game_shared/bot/nav_file.cpp @@ -139,7 +139,7 @@ public: } /// load the directory - void Load( SteamFile *file ) + bool Load( SteamFile *file ) { // read number of entries EntryType count; @@ -156,7 +156,7 @@ public: if ( len >= sizeof( placeName ) ) { assert( false && "PlaceDirectory::Load: Invalid placeName size" ); - return; + return false; } file->Read( placeName, len ); @@ -164,6 +164,8 @@ public: AddPlace( TheBotPhrases->NameToID( placeName ) ); } + + return true; } private: @@ -1020,7 +1022,11 @@ NavErrorType LoadNavigationMap( void ) // load Place directory 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