This is how to fix the bed / chair in a room with stairs and also fix pillows to be stacked and be seated on, still looking how to resolve that for chairs when stacking :
Heightinfo.cs
PHP Code:
using System;
namespace Phoenix.HabboHotel.Pathfinding
{
internal struct HeightInfo
{
private double[,] mMap;
private double[,] double_1;
private double[,] double_2;
private int mMaxX;
private int mMaxY;
public HeightInfo(int MaxX, int MaxY, double[,] Map, double[,] double_4, double[,] double_5)
{
this.mMap = Map;
this.double_2 = double_4;
this.double_1 = double_5;
this.mMaxX = MaxX;
this.mMaxY = MaxY;
}
internal double GetState(int MaxX, int MaxY)
{
double result;
if ((MaxX >= this.mMaxX) || (MaxX < 0))
{
return 0.0;
}
else
{
if ((MaxY >= this.mMaxY) || (MaxY < 0))
{
result = 0.0;
}
else
{
if (this.double_2[MaxX, MaxY] > this.mMap[MaxX, MaxY] && this.double_1[MaxX, MaxY] == 0.0)
{
result = this.double_2[MaxX, MaxY];
}
else
{
if (this.double_1[MaxX, MaxY] == 0.0)
{
result = this.mMap[MaxX, MaxY];
}
else
{
result = this.double_1[MaxX, MaxY];
}
}
}
}
return result;
}
}
}