Add Map.DistanceAboveTerrain(WPos) and Actor.IsAtGroundLevel() extension method
This commit is contained in:
@@ -104,8 +104,7 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
|
||||
public void Render(WorldRenderer wr)
|
||||
{
|
||||
// TODO: This is a temporary workaround until we have a proper ramp-aware height calculation
|
||||
var groundPos = wr.World.Map.CenterOfCell(wr.World.Map.CellContaining(voxel.pos));
|
||||
var groundPos = voxel.pos - new WVec(0, 0, wr.World.Map.DistanceAboveTerrain(voxel.pos).Length);
|
||||
|
||||
var ts = Game.ModData.Manifest.TileSize;
|
||||
var groundZ = ts.Height * (groundPos.Z - voxel.pos.Z) / 1024f;
|
||||
|
||||
Reference in New Issue
Block a user