#4814 closed defect (fixed)
Consistently exclude invalid mapborder tiles from rmgen
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 23 |
Component: | Maps | Keywords: | |
Cc: | Patch: |
Description
There are three tiles near the map border that cannot be passed nor explored (and thus are always black).
That magic number is hardcoded in the pathfinder, rangemanager and rmgen
(MAP_BORDER_WIDTH
), see #4636.
The SimpleObject
and its duplicate RandomObject
have place functions that do not account for the map border.
So the SimpleGroup
place function calling these assumed the object was placed while it actually wasn't.
This does not show any noticeable bug in alpha 22 yet.
But if we add a retry loop for starting resources on maps that place the players very close to the map border (like Danubius on the tiny mapsize, or the Oasis replay in #4796), it will ensure that the starting resources are actually placed.
validT(x, y, dist)
should return true, if the given coordinates are at least dist
tiles within the valid region of tiles.
So it should be the responsability of that function and not of each caller to apply that constant.
Change History (5)
comment:1 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 7 years ago
Similar work in #4012.
While all calls to validT
do exclude these 3 tiles, there are placers which do not but should use validT
, see Phab:rP14183#inline-688
This can be fixed by removing the duplicate code by just calling the copy, see Phab:rP9388.
In 20283: