Fix bug #12121: Map: Highway broken with 2.1. Be more lenient with broken maps, since we do not

have a map editor that we can fix: If the next feature in the map overlaps another, remove the 
already placed feature in favour of the new one.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5782 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-08-07 16:02:22 +00:00
parent 6f89f25b80
commit 35b32a31db
1 changed files with 10 additions and 3 deletions

View File

@ -386,9 +386,16 @@ FEATURE * buildFeature(FEATURE_STATS *psStats, UDWORD x, UDWORD y,BOOL FromSave)
if (width != psStats->baseWidth && breadth != psStats->baseBreadth)
{
ASSERT( !(TileHasFeature(psTile)),
"buildFeature - feature- %d already found at %d, %d",
psFeature->id, mapX+width,mapY+breadth );
if (TileHasFeature(psTile))
{
FEATURE *psBlock = (FEATURE *)psTile->psObject;
debug(LOG_ERROR, "%s(%d) already placed at (%d+%d, %d+%d) when trying to place %s(%d) at (%d+%d, %d+%d) - removing it",
getName(psBlock->psStats->pName), psBlock->id, map_coord(psBlock->pos.x), psBlock->psStats->baseWidth, map_coord(psBlock->pos.y),
psBlock->psStats->baseBreadth, getName(psFeature->psStats->pName), psFeature->id, mapX, psStats->baseWidth, mapY, psStats->baseBreadth);
removeFeature(psBlock);
}
psTile->psObject = (BASE_OBJECT*)psFeature;