Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Source/ACE.DatLoader/Entity/CBldPortal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
30 changes: 0 additions & 30 deletions Source/ACE.Server/Physics/Common/BldPortal.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using ACE.Entity.Enum;

namespace ACE.Server.Physics.Common
Expand All @@ -10,7 +9,6 @@ public class BldPortal
public bool PortalSide;
public ushort OtherCellId;
public ushort OtherPortalId;
public List<ushort> StabList;

public BldPortal() { }

Expand All @@ -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)
Expand All @@ -31,32 +28,5 @@ public EnvCell GetOtherCell(uint landblockID)
return (EnvCell)LScape.get_landcell(blockCellID);
}

public void add_to_stablist(ref List<ushort> 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<ushort>();
maxSize += 10;
foreach (var stab in StabList)
stabList.Add(stab);
}
stabList.Add(StabList[i]);
stabNum++;
}
}
}
}
}
6 changes: 0 additions & 6 deletions Source/ACE.Server/Physics/Common/BuildingObj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ public void add_to_cell(SortCell newCell)
CurCell = newCell;
}

public void add_to_stablist(ref List<ushort> 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)
Expand Down
10 changes: 2 additions & 8 deletions Source/ACE.Server/Physics/Common/Landblock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class Landblock: LandblockStruct
public LandblockInfo Info;
public List<PhysicsObj> StaticObjects;
public List<BuildingObj> Buildings;
public List<ushort> StabList;
public List<LandCell> DrawArray;
public List<PhysicsObj> Scenery;
public List<PhysicsObj> ServerObjects { get; set; }
Expand Down Expand Up @@ -154,7 +153,6 @@ public void destroy_buildings()
building.remove();

Buildings.Clear();
StabList.Clear();
}

public void destroy_static_objects()
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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;
Expand Down