Spring.GetGroundExtreme & in-game heightmap changes
Posted: 31 Jan 2015, 23:38
I posted this as a mantis bug, but jK is certain Spring.GetGroundExtremes() is fine under all circumstances. To me it appears that Spring.GetGroundExtremes() returns the extremes of the heightmap when it's first loaded only. If the heightmap is changed with lua functions such as Spring.AdjustHeightMap(), or deformed by explosions in such a way as to create a new minimum or maximum, Spring.GetGroundExtremes() will return the same values as it did when the map loaded.
Attached is a screenshot showing a height at cursor of 92, yet a gadget prints the minimum height from Spring.GetGroundExtremes as 108. The height is 92 after a BA commander explosion.
here's the gadget used to test:
am i doing something wrong?
Attached is a screenshot showing a height at cursor of 92, yet a gadget prints the minimum height from Spring.GetGroundExtremes as 108. The height is 92 after a BA commander explosion.
here's the gadget used to test:
Code: Select all
function gadget:GetInfo()
return {
name = "Loony: Heightmap Test",
desc = "heightmap test.",
author = "zoggop",
date = "January 2015",
license = "whatever",
layer = 10,
enabled = true
}
end
-- synced --------------------------------------------------------------------
if gadgetHandler:IsSyncedCode() then
function gadget:UnitCreated()
Spring.Echo(Spring.GetGroundExtremes())
end
end