Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ef0ac74b90bfb542d75ce25cbcd535a222031898
- diff --git a/contrib/vmap_extractor_v3/vmapextract/vmapexport.cpp b/contrib/vmap_extractor_v3/vmapextract/vmapexport.cpp
- index 0b46f40..101ca2c 100644
- --- a/contrib/vmap_extractor_v3/vmapextract/vmapexport.cpp
- +++ b/contrib/vmap_extractor_v3/vmapextract/vmapexport.cpp
- @@ -83,28 +83,6 @@ static const char * GetPlainName(const char * szFileName)
- return szFileName;
- }
- -// copied from contrib/extractor/System.cpp
- -void ReadLiquidTypeTableDBC()
- -{
- - printf("Read LiquidType.dbc file...");
- - DBCFile dbc("DBFilesClient\\LiquidType.dbc");
- - 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.getRecord(LiqType_count - 1).getUInt(0);
- - LiqType = new uint16[LiqType_maxid + 1];
- - memset(LiqType, 0xff, (LiqType_maxid + 1) * sizeof(uint16));
- -
- - for(uint32 x = 0; x < LiqType_count; ++x)
- - LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
- -
- - printf("Done! (%u LiqTypes loaded)\n", (unsigned int)LiqType_count);
- -}
- -
- int ExtractWmo()
- {
- char szLocalFile[1024] = "";
- @@ -486,7 +464,6 @@ int main(int argc, char ** argv)
- printf("FATAL ERROR: None MPQ archive found by path '%s'. Use -d option with proper path.\n",input_path);
- return 1;
- }
- - ReadLiquidTypeTableDBC();
- // extract data
- if(success)
- @@ -527,6 +504,5 @@ int main(int argc, char ** argv)
- }
- printf("Extract %s. Work complete. No errors.\n",versionString);
- - delete [] LiqType;
- return 0;
- }
- diff --git a/contrib/vmap_extractor_v3/vmapextract/wmo.cpp b/contrib/vmap_extractor_v3/vmapextract/wmo.cpp
- index 6a3e940..b1a4b52 100644
- --- a/contrib/vmap_extractor_v3/vmapextract/wmo.cpp
- +++ b/contrib/vmap_extractor_v3/vmapextract/wmo.cpp
- @@ -382,22 +382,13 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPrecis
- int LIQU_h[] = {0x5551494C, sizeof(WMOLiquidHeader) + LiquEx_size + hlq->xtiles*hlq->ytiles};// "LIQU"
- fwrite(LIQU_h, 4, 2, output);
- - // according to WoW.Dev Wiki:
- - uint32 liquidEntry;
- - if (rootWMO->liquidType & 4)
- - liquidEntry = liquidType;
- - else if (liquidType == 15)
- - liquidEntry = 1; // first entry, generic "Water"
- - else
- - liquidEntry = liquidType + 1;
- - // overwrite material type in header...
- - hlq->type = LiqType[liquidEntry];
- -
- /* std::ofstream llog("Buildings/liquid.log", ios_base::out | ios_base::app);
- llog << filename;
- - llog << ":\nliquidEntry: " << liquidEntry << " type: " << hlq->type << " (root:" << rootWMO->liquidType << " group:" << liquidType << ")\n";
- + llog << ":\ntype: " << hlq->type << " (root:" << rootWMO->liquidType << " group:" << liquidType << ")\n";
- llog.close(); */
- + hlq->type = ConvertLiquidType(hlq->type, filename);
- +
- fwrite(hlq, sizeof(WMOLiquidHeader), 1, output);
- // only need height values, the other values are unknown anyway
- for (uint32 i = 0; i<LiquEx_size/sizeof(WMOLiquidVert); ++i)
- @@ -409,6 +400,24 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPrecis
- return nColTriangles;
- }
- +int WMOGroup::ConvertLiquidType(int hlqLiquid, std::string &filename)
- +{
- + if (hlqLiquid == 4) // lava in Blackrock Mountain, Blackrock Depths, Blackrock Spire and Old Ironforge
- + return 2;
- +
- + filename = filename.substr(0, filename.find_last_of("\\")); // trim filename
- + filename = filename.substr(filename.find_last_of("\\") + 1); // trim everything except current wmo path part
- +
- + if (hlqLiquid == 3 && filename == "AZ_Blackrock") // lava in Molten Cire
- + return 2;
- + else if (filename == "KL_OrgrimmarLavaDungeon") // lava in Ragefire Chasm
- + return 2;
- + else if (hlqLiquid == 8 && filename == "LD_Stratholme") // slime in Naxxramas
- + return 3;
- + else
- + return 0;
- +}
- +
- WMOGroup::~WMOGroup()
- {
- delete [] MOPY;
- diff --git a/contrib/vmap_extractor_v3/vmapextract/wmo.h b/contrib/vmap_extractor_v3/vmapextract/wmo.h
- index 12979bc..a9edc41 100644
- --- a/contrib/vmap_extractor_v3/vmapextract/wmo.h
- +++ b/contrib/vmap_extractor_v3/vmapextract/wmo.h
- @@ -91,6 +91,7 @@ public:
- bool open();
- int ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPreciseVectorData);
- + int ConvertLiquidType(int hlqLiquid, std::string &filename);
- private:
- std::string filename;
- diff --git a/src/game/Player.cpp b/src/game/Player.cpp
- index ddd9fa0..fc7623d 100644
- --- a/src/game/Player.cpp
- +++ b/src/game/Player.cpp
- @@ -1060,9 +1060,7 @@ void Player::HandleDrowning(uint32 time_diff)
- uint32 damage = urand(600, 700);
- if (m_MirrorTimerFlags&UNDERWATER_INLAVA)
- EnvironmentalDamage(DAMAGE_LAVA, damage);
- - // need to skip Slime damage in Undercity,
- - // maybe someone can find better way to handle environmental damage
- - else if (m_zoneUpdateId != 1497)
- + else
- EnvironmentalDamage(DAMAGE_SLIME, damage);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment