diff --git a/contrib/extractor/System.cpp b/contrib/extractor/System.cpp index 49190f65b..843fe616e 100644 --- a/contrib/extractor/System.cpp +++ b/contrib/extractor/System.cpp @@ -207,7 +207,7 @@ void ReadLiquidTypeTableDBC() // Map file format data #define MAP_MAGIC 'SPAM' -#define MAP_VERSION_MAGIC '0.1v' +#define MAP_VERSION_MAGIC '0.1w' #define MAP_AREA_MAGIC 'AERA' #define MAP_HEIGTH_MAGIC 'TGHM' #define MAP_LIQUID_MAGIC 'QILM' @@ -304,7 +304,6 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x) memset(liquid_show, 0, sizeof(liquid_show)); memset(liquid_type, 0, sizeof(liquid_type)); - memset(liquid_height, 0, sizeof(liquid_height)); // Prepare map header map_fileheader map; @@ -709,6 +708,8 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x) if (maxHeight < h) maxHeight = h; if (minHeight > h) minHeight = h; } + else + liquid_height[y][x] = CONF_use_minHeight; } } map.liquidMapOffset = map.heightMapOffset + map.heightMapSize; @@ -812,11 +813,11 @@ void ExtractMapsFromMpq() printf("Convert map files\n"); for(uint32 z = 0; z < map_count; ++z) { - printf("Extract %s (%d/%d) \n", map_ids[z].name, z, map_count); + printf("Extract %s (%d/%d) \n", map_ids[z].name, z+1, map_count); // Loadup map grid data sprintf(mpq_map_name, "World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name); WDT_file wdt; - if (!wdt.loadFile(mpq_map_name)) + if (!wdt.loadFile(mpq_map_name, false)) { // printf("Error loading %s map wdt data\n", map_ids[z].name); continue; diff --git a/contrib/extractor/ad.exe b/contrib/extractor/ad.exe index f3a475c4e..8300b697c 100755 Binary files a/contrib/extractor/ad.exe and b/contrib/extractor/ad.exe differ diff --git a/contrib/extractor/loadlib/loadlib.cpp b/contrib/extractor/loadlib/loadlib.cpp index 2ff045ed7..ed5bd9acb 100644 --- a/contrib/extractor/loadlib/loadlib.cpp +++ b/contrib/extractor/loadlib/loadlib.cpp @@ -17,13 +17,14 @@ FileLoader::~FileLoader() free(); } -bool FileLoader::loadFile(char *filename) +bool FileLoader::loadFile(char *filename, bool log) { free(); MPQFile mf(filename); if(mf.isEof()) { - printf("No such file %s\n", filename); + if (log) + printf("No such file %s\n", filename); return false; } diff --git a/contrib/extractor/loadlib/loadlib.h b/contrib/extractor/loadlib/loadlib.h index 7f38768cf..6acfd107e 100644 --- a/contrib/extractor/loadlib/loadlib.h +++ b/contrib/extractor/loadlib/loadlib.h @@ -51,7 +51,7 @@ public: file_MVER *version; FileLoader(); ~FileLoader(); - bool loadFile(char *filename); + bool loadFile(char *filename, bool log = true); virtual void free(); }; #endif diff --git a/sql/mangos.sql b/sql/mangos.sql index 0fbc1a574..9c54def8b 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, - `required_7422_01_mangos_mangos_string` bit(1) default NULL + `required_7439_01_mangos_mangos_string` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -2409,6 +2409,7 @@ INSERT INTO `mangos_string` VALUES (172,'server console command',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (173,'You changed runic power of %s to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (174,'%s changed your runic power to %i/%i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(175,'Liquid level: %f, ground: %f, type: %d, status: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (200,'No selection.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (201,'Object GUID is: lowpart %u highpart %X',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (202,'The name was too long by %i characters.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), diff --git a/sql/updates/7439_01_mangos_mangos_string.sql b/sql/updates/7439_01_mangos_mangos_string.sql new file mode 100644 index 000000000..7dd26e104 --- /dev/null +++ b/sql/updates/7439_01_mangos_mangos_string.sql @@ -0,0 +1,5 @@ +ALTER TABLE db_version CHANGE COLUMN required_7422_01_mangos_mangos_string required_7439_01_mangos_mangos_string bit; + +DELETE FROM mangos_string WHERE entry in (175); +INSERT INTO mangos_string VALUES + (175,'Liquid level: %f, ground: %f, type: %d, status: %d',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index c1ea02a7b..7f44538c8 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -196,6 +196,7 @@ pkgdata_DATA = \ 7393_01_mangos_game_event.sql \ 7399_01_mangos_mangos_string.sql \ 7422_01_mangos_mangos_string.sql \ + 7439_01_mangos_mangos_string.sql \ README ## Additional files to include when running 'make dist' @@ -372,4 +373,5 @@ EXTRA_DIST = \ 7393_01_mangos_game_event.sql \ 7399_01_mangos_mangos_string.sql \ 7422_01_mangos_mangos_string.sql \ + 7439_01_mangos_mangos_string.sql \ README diff --git a/src/game/Language.h b/src/game/Language.h index a0fb566e2..c25d1e6f4 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -170,7 +170,8 @@ enum MangosStrings LANG_CONSOLE_COMMAND = 172, LANG_YOU_CHANGE_RUNIC_POWER = 173, LANG_YOURS_RUNIC_POWER_CHANGED = 174, - // Room for more level 1 175-199 not used + LANG_LIQUID_STATUS = 175, + // Room for more level 1 176-199 not used // level 2 chat LANG_NO_SELECTION = 200, diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 0cd1d08e1..85eb69920 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -331,6 +331,12 @@ bool ChatHandler::HandleGPSCommand(const char* args) cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(), zone_x, zone_y, ground_z, floor_z, have_map, have_vmap ); + LiquidData liquid_status; + ZLiquidStatus res = map->getLiquidStatus(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), MAP_ALL_LIQUIDS, &liquid_status); + if (res) + { + PSendSysMessage(LANG_LIQUID_STATUS, liquid_status.level, liquid_status.depth_level, liquid_status.type, res); + } return true; } diff --git a/src/game/Map.h b/src/game/Map.h index 8019534ed..7aada6e31 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -72,7 +72,7 @@ typedef MaNGOS::SingleThreaded::Lock NullGuard; // Map file format defines //****************************************** #define MAP_MAGIC 'SPAM' -#define MAP_VERSION_MAGIC '0.1v' +#define MAP_VERSION_MAGIC '0.1w' #define MAP_AREA_MAGIC 'AERA' #define MAP_HEIGTH_MAGIC 'TGHM' #define MAP_LIQUID_MAGIC 'QILM' diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 838a591c8..b4cca7098 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7438" + #define REVISION_NR "7439" #endif // __REVISION_NR_H__