diff --git a/Source/ACE.DatLoader/Entity/CBldPortal.cs b/Source/ACE.DatLoader/Entity/CBldPortal.cs index 28ba03507f..62ae4b8ba7 100644 --- a/Source/ACE.DatLoader/Entity/CBldPortal.cs +++ b/Source/ACE.DatLoader/Entity/CBldPortal.cs @@ -8,9 +8,11 @@ public class CBldPortal : IUnpackable { public PortalFlags Flags { get; private set; } - // Not sure what these do. They are both calculated from the flags. + // Turbine's CBldPortal::UnPack decodes ExactMatch from bit 0 (0x0001), + // and PortalSide from the inverse of bit 1 (0x0002). + // The bit behavior is verified; the gameplay meaning of these flags is not. public bool ExactMatch => Flags.HasFlag(PortalFlags.ExactMatch); - public bool PortalSide => !Flags.HasFlag(PortalFlags.PortalSide); // this->portal_side = ((unsigned __int8)~(_BYTE)v5 >> 1) & 1; + public bool PortalSide => !Flags.HasFlag(PortalFlags.PortalSide); // Basically the cells that connect both sides of the portal public ushort OtherCellId { get; private set; } diff --git a/Source/ACE.Server/Physics/Common/BldPortal.cs b/Source/ACE.Server/Physics/Common/BldPortal.cs index ae1746d678..50751a6504 100644 --- a/Source/ACE.Server/Physics/Common/BldPortal.cs +++ b/Source/ACE.Server/Physics/Common/BldPortal.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using ACE.Entity.Enum; namespace ACE.Server.Physics.Common @@ -10,7 +9,6 @@ public class BldPortal public bool PortalSide; public ushort OtherCellId; public ushort OtherPortalId; - public List StabList; public BldPortal() { } @@ -21,7 +19,6 @@ public BldPortal(DatLoader.Entity.CBldPortal bldPortal) PortalSide = bldPortal.PortalSide; OtherCellId = bldPortal.OtherCellId; OtherPortalId = bldPortal.OtherPortalId; - StabList = bldPortal.StabList; } public EnvCell GetOtherCell(uint landblockID) @@ -31,32 +28,5 @@ public EnvCell GetOtherCell(uint landblockID) return (EnvCell)LScape.get_landcell(blockCellID); } - public void add_to_stablist(ref List stabList, ref uint maxSize, ref uint stabNum) - { - // is maxSize needed with list? - for (var i = 0; i < StabList.Count; i++) - { - var j = (int)stabNum; - while (j > 0) - { - if (StabList[i] == stabList[j - 1]) - break; - j--; - } - if (j > 0) - { - if (stabNum >= maxSize) - { - var old = stabList; - stabList = new List(); - maxSize += 10; - foreach (var stab in StabList) - stabList.Add(stab); - } - stabList.Add(StabList[i]); - stabNum++; - } - } - } } } diff --git a/Source/ACE.Server/Physics/Common/BuildingObj.cs b/Source/ACE.Server/Physics/Common/BuildingObj.cs index ebed3716b1..00abef5149 100644 --- a/Source/ACE.Server/Physics/Common/BuildingObj.cs +++ b/Source/ACE.Server/Physics/Common/BuildingObj.cs @@ -30,12 +30,6 @@ public void add_to_cell(SortCell newCell) CurCell = newCell; } - public void add_to_stablist(ref List blockStabList, ref uint maxSize, ref uint stabNum) - { - foreach (var portal in Portals) - portal.add_to_stablist(ref blockStabList, ref maxSize, ref stabNum); - } - public TransitionState find_building_collisions(Transition transition) { if (PartArray == null) diff --git a/Source/ACE.Server/Physics/Common/Landblock.cs b/Source/ACE.Server/Physics/Common/Landblock.cs index 3fc59d53f2..f3ec5ac7c2 100644 --- a/Source/ACE.Server/Physics/Common/Landblock.cs +++ b/Source/ACE.Server/Physics/Common/Landblock.cs @@ -28,7 +28,6 @@ public class Landblock: LandblockStruct public LandblockInfo Info; public List StaticObjects; public List Buildings; - public List StabList; public List DrawArray; public List Scenery; public List ServerObjects { get; set; } @@ -154,7 +153,6 @@ public void destroy_buildings() building.remove(); Buildings.Clear(); - StabList.Clear(); } public void destroy_static_objects() @@ -426,15 +424,13 @@ public uint get_terrain(uint cellID, Vector3 point) public void grab_visible_cells() { - // legacy method - //EnvCell.grab_visible(StabList); + // Legacy visibility tracking is inactive. } public void init_buildings() { if (Info == null || SideCellCount != 8) return; - uint maxSize = 0, stabNum = 0; foreach (var info in Info.Buildings) { var building = BuildingObj.makeBuilding(info.ModelId, info.Portals, info.NumLeaves); @@ -451,7 +447,6 @@ public void init_buildings() building.add_to_cell(cell); // SortCell? Buildings.Add(building); - building.add_to_stablist(ref StabList, ref maxSize, ref stabNum); } } @@ -562,8 +557,7 @@ public void release_shadow_objs() public void release_visible_cells() { - // legacy method - //EnvCell.release_visible(StabList); + // Legacy visibility tracking is inactive. } private bool? isDungeon;