diff --git a/Source/Framework/Constants/MapConst.cs b/Source/Framework/Constants/MapConst.cs index 7b55deac9..3ca6f809a 100644 --- a/Source/Framework/Constants/MapConst.cs +++ b/Source/Framework/Constants/MapConst.cs @@ -43,13 +43,13 @@ namespace Framework.Constants public const uint ReadycheckDuration = 35000; //Liquid - public const int MapLiquidTypeNoWater = 0x00; - public const int MapLiquidTypeWater = 0x01; - public const int MapLiquidTypeOcean = 0x02; - public const int MapLiquidTypeMagma = 0x04; - public const int MapLiquidTypeSlime = 0x08; - public const int MapLiquidTypeDarkWater = 0x10; - public const int MapAllLiquidTypes = (MapLiquidTypeWater | MapLiquidTypeOcean | MapLiquidTypeMagma | MapLiquidTypeSlime); + public const uint MapLiquidTypeNoWater = 0x00; + public const uint MapLiquidTypeWater = 0x01; + public const uint MapLiquidTypeOcean = 0x02; + public const uint MapLiquidTypeMagma = 0x04; + public const uint MapLiquidTypeSlime = 0x08; + public const uint MapLiquidTypeDarkWater = 0x10; + public const uint MapAllLiquidTypes = (MapLiquidTypeWater | MapLiquidTypeOcean | MapLiquidTypeMagma | MapLiquidTypeSlime); public const float LiquidTileSize = (533.333f / 128.0f); public const int MinMapUpdateDelay = 50; diff --git a/Source/Game/Collision/Management/VMapManager.cs b/Source/Game/Collision/Management/VMapManager.cs index e437d2317..cd57bde39 100644 --- a/Source/Game/Collision/Management/VMapManager.cs +++ b/Source/Game/Collision/Management/VMapManager.cs @@ -209,7 +209,7 @@ namespace Game.Collision return false; } - public bool GetLiquidLevel(uint mapId, float x, float y, float z, byte reqLiquidType, ref float level, ref float floor, ref uint type) + public bool GetLiquidLevel(uint mapId, float x, float y, float z, uint reqLiquidType, ref float level, ref float floor, ref uint type) { if (!Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, DisableFlags.VmapLiquidStatus)) { diff --git a/Source/Game/Maps/GridMap.cs b/Source/Game/Maps/GridMap.cs index cee848c5c..47e4ccf01 100644 --- a/Source/Game/Maps/GridMap.cs +++ b/Source/Game/Maps/GridMap.cs @@ -504,7 +504,7 @@ namespace Game.Maps } // Get water state on map - public ZLiquidStatus getLiquidStatus(float x, float y, float z, byte ReqLiquidType, LiquidData data) + public ZLiquidStatus getLiquidStatus(float x, float y, float z, uint ReqLiquidType, LiquidData data) { // Check water type (if no water return) if (_liquidGlobalFlags == 0 && _liquidFlags == null) @@ -524,7 +524,7 @@ namespace Game.Maps LiquidTypeRecord liquidEntry = CliDB.LiquidTypeStorage.LookupByKey(entry); if (liquidEntry != null) { - type &= MapConst.MapLiquidTypeDarkWater; + type &= (byte)MapConst.MapLiquidTypeDarkWater; uint liqTypeIdx = liquidEntry.SoundBank; if (entry < 21) { diff --git a/Source/Game/Maps/GridNotifiers.cs b/Source/Game/Maps/GridNotifiers.cs index abb05765e..ac7af9e8e 100644 --- a/Source/Game/Maps/GridNotifiers.cs +++ b/Source/Game/Maps/GridNotifiers.cs @@ -382,7 +382,7 @@ namespace Game.Maps public override void Visit(ICollection objs) { - foreach (var player in objs) + foreach (var player in objs.ToList()) { if (!player.IsInPhase(i_source)) continue; diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index c32181978..160306898 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -1977,13 +1977,13 @@ namespace Game.Maps return 0; } - public ZLiquidStatus getLiquidStatus(PhaseShift phaseShift, float x, float y, float z, byte ReqLiquidType) + public ZLiquidStatus getLiquidStatus(PhaseShift phaseShift, float x, float y, float z, uint ReqLiquidType) { LiquidData throwaway; return getLiquidStatus(phaseShift, x, y, z, ReqLiquidType, out throwaway); } - public ZLiquidStatus getLiquidStatus(PhaseShift phaseShift, float x, float y, float z, byte ReqLiquidType, out LiquidData data) + public ZLiquidStatus getLiquidStatus(PhaseShift phaseShift, float x, float y, float z, uint ReqLiquidType, out LiquidData data) { data = new LiquidData(); var result = ZLiquidStatus.NoWater; diff --git a/Source/Game/Movement/Generators/PathGenerator.cs b/Source/Game/Movement/Generators/PathGenerator.cs index c4f8b1409..875e77363 100644 --- a/Source/Game/Movement/Generators/PathGenerator.cs +++ b/Source/Game/Movement/Generators/PathGenerator.cs @@ -838,6 +838,7 @@ namespace Game.Movement if (liquidStatus == ZLiquidStatus.NoWater) return NavTerrain.Ground; + data.type_flags &= ~MapConst.MapLiquidTypeDarkWater; switch (data.type_flags) { case MapConst.MapLiquidTypeWater: