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-861f7616d084master
parent
6f89f25b80
commit
35b32a31db
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue