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; public const uint ReadycheckDuration = 35000;
//Liquid //Liquid
public const int MapLiquidTypeNoWater = 0x00; public const uint MapLiquidTypeNoWater = 0x00;
public const int MapLiquidTypeWater = 0x01; public const uint MapLiquidTypeWater = 0x01;
public const int MapLiquidTypeOcean = 0x02; public const uint MapLiquidTypeOcean = 0x02;
public const int MapLiquidTypeMagma = 0x04; public const uint MapLiquidTypeMagma = 0x04;
public const int MapLiquidTypeSlime = 0x08; public const uint MapLiquidTypeSlime = 0x08;
public const int MapLiquidTypeDarkWater = 0x10; public const uint MapLiquidTypeDarkWater = 0x10;
public const int MapAllLiquidTypes = (MapLiquidTypeWater | MapLiquidTypeOcean | MapLiquidTypeMagma | MapLiquidTypeSlime); public const uint MapAllLiquidTypes = (MapLiquidTypeWater | MapLiquidTypeOcean | MapLiquidTypeMagma | MapLiquidTypeSlime);
public const float LiquidTileSize = (533.333f / 128.0f); public const float LiquidTileSize = (533.333f / 128.0f);
public const int MinMapUpdateDelay = 50; public const int MinMapUpdateDelay = 50;
@@ -209,7 +209,7 @@ namespace Game.Collision
return false; 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)) 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 // 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) // Check water type (if no water return)
if (_liquidGlobalFlags == 0 && _liquidFlags == null) if (_liquidGlobalFlags == 0 && _liquidFlags == null)
@@ -524,7 +524,7 @@ namespace Game.Maps
LiquidTypeRecord liquidEntry = CliDB.LiquidTypeStorage.LookupByKey(entry); LiquidTypeRecord liquidEntry = CliDB.LiquidTypeStorage.LookupByKey(entry);
if (liquidEntry != null) if (liquidEntry != null)
{ {
type &= MapConst.MapLiquidTypeDarkWater; type &= (byte)MapConst.MapLiquidTypeDarkWater;
uint liqTypeIdx = liquidEntry.SoundBank; uint liqTypeIdx = liquidEntry.SoundBank;
if (entry < 21) if (entry < 21)
{ {
+1 -1
View File
@@ -382,7 +382,7 @@ namespace Game.Maps
public override void Visit(ICollection<Player> objs) public override void Visit(ICollection<Player> objs)
{ {
foreach (var player in objs) foreach (var player in objs.ToList())
{ {
if (!player.IsInPhase(i_source)) if (!player.IsInPhase(i_source))
continue; continue;
+2 -2
View File
@@ -1977,13 +1977,13 @@ namespace Game.Maps
return 0; 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; LiquidData throwaway;
return getLiquidStatus(phaseShift, x, y, z, ReqLiquidType, out 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(); data = new LiquidData();
var result = ZLiquidStatus.NoWater; var result = ZLiquidStatus.NoWater;
@@ -838,6 +838,7 @@ namespace Game.Movement
if (liquidStatus == ZLiquidStatus.NoWater) if (liquidStatus == ZLiquidStatus.NoWater)
return NavTerrain.Ground; return NavTerrain.Ground;
data.type_flags &= ~MapConst.MapLiquidTypeDarkWater;
switch (data.type_flags) switch (data.type_flags)
{ {
case MapConst.MapLiquidTypeWater: case MapConst.MapLiquidTypeWater: