Core/Movement: Fixed PathGenerator.GetNavTerrain returning ground instead of water in fatigue area

This commit is contained in:
hondacrx
2018-04-16 14:14:16 -04:00
parent bcc61c3ab9
commit 77f981d868
6 changed files with 14 additions and 13 deletions
+7 -7
View File
@@ -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;
@@ -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))
{
+2 -2
View File
@@ -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)
{
+1 -1
View File
@@ -382,7 +382,7 @@ namespace Game.Maps
public override void Visit(ICollection<Player> objs)
{
foreach (var player in objs)
foreach (var player in objs.ToList())
{
if (!player.IsInPhase(i_source))
continue;
+2 -2
View File
@@ -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;
@@ -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: