In spring you can test if a building can be built by checking if the heightdifference underneath a footprint is bigger than the max allowed height difference.
This would suggest:
if Biggestheigh - lowestheight > maxheightdiff
Then you cant build.
This is not true.
Instead there's a hugely longwinded process involving lots of loops and averaging calculations.
CanBuildAt() and hugely complicated code
Moderator: Moderators
- clericvash
- Posts: 1394
- Joined: 05 Oct 2004, 01:05
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
We could rewrite the one single function and return to OTA style quite easily, it'd invovle a lto less computation
Code: Select all
highest = lowestpossibleheight
lowest = highest
for each gamesquare in footprint
if higher than highest
highest = this height
if lower than lowest
lowest = this height
return (highest - lowest < MaxSlope)