diff options
author | megamage <none@none> | 2009-03-12 14:48:44 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-12 14:48:44 -0600 |
commit | 4d62cf902feaf5288f7438b1005a9e6aa299462e (patch) | |
tree | 60b52e9a00ca39f773992789bcc7a8306dc3cfa9 /contrib/extractor/System.cpp | |
parent | f7f6d6558ccb854a1321d9d6f0a2c9d2f6efb9aa (diff) |
[7443] Better error reporting at DBC files extraction in ad.exe. No functionlity chnages in normal work case. Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'contrib/extractor/System.cpp')
-rw-r--r-- | contrib/extractor/System.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/contrib/extractor/System.cpp b/contrib/extractor/System.cpp index 2696c7b1a2b..75cc5ba92e4 100644 --- a/contrib/extractor/System.cpp +++ b/contrib/extractor/System.cpp @@ -153,7 +153,12 @@ uint32 ReadMapDBC() { printf("Read Map.dbc file... "); DBCFile dbc("DBFilesClient\\Map.dbc"); - dbc.open(); + + if(!dbc.open()) + { + printf("Fatal error: Invalid Map.dbc file format!\n"); + exit(1); + } size_t map_count = dbc.getRecordCount(); map_ids = new map_id[map_count]; @@ -170,7 +175,12 @@ void ReadAreaTableDBC() { printf("Read AreaTable.dbc file..."); DBCFile dbc("DBFilesClient\\AreaTable.dbc"); - dbc.open(); + + if(!dbc.open()) + { + printf("Fatal error: Invalid AreaTable.dbc file format!\n"); + exit(1); + } size_t area_count = dbc.getRecordCount(); size_t maxid = dbc.getMaxId(); @@ -189,7 +199,12 @@ void ReadLiquidTypeTableDBC() { printf("Read LiquidType.dbc file..."); DBCFile dbc("DBFilesClient\\LiquidType.dbc"); - dbc.open(); + if(!dbc.open()) + { + printf("Fatal error: Invalid LiquidType.dbc file format!\n"); + exit(1); + } + size_t LiqType_count = dbc.getRecordCount(); size_t LiqType_maxid = dbc.getMaxId(); LiqType = new uint16[LiqType_maxid + 1]; |