- Big Maps: fixed road placing in map editor

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3512 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
bugmonster
2010-05-17 17:25:54 +00:00
parent a7b0a1510e
commit 1ba80f3436
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -408,10 +408,15 @@ void PlaceRoadMacroAtGridNo( INT32 iMapIndex, INT32 iMacroID )
i = gsRoadMacroStartIndex[ iMacroID ];
while( gRoadMacros[ i ].sMacroID == iMacroID )
{
AddToUndoList( iMapIndex + gRoadMacros[ i ].sOffset );
RemoveAllObjectsOfTypeRange( iMapIndex + gRoadMacros[ i ].sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
// need to recalc MACROSTRUCT::sOffset 'cause it sticked to 160*160 old map size
INT32 sdX = gRoadMacros[ i ].sOffset % OLD_WORLD_COLS;
INT32 sdY = gRoadMacros[ i ].sOffset / OLD_WORLD_COLS;
INT32 sOffset = sdY*WORLD_COLS + sdX;
//
AddToUndoList( iMapIndex + sOffset );
RemoveAllObjectsOfTypeRange( iMapIndex + sOffset, ROADPIECES, ROADPIECES );//dnl this was but is very wrong and leading to stacking tilesets, RemoveAllObjectsOfTypeRange( i, ROADPIECES, ROADPIECES );
GetTileIndexFromTypeSubIndex( ROADPIECES, (UINT16)(i+1) , &usTileIndex );
AddObjectToHead( iMapIndex + gRoadMacros[ i ].sOffset, usTileIndex );
AddObjectToHead( iMapIndex + sOffset, usTileIndex );
i++;
}
}
+1 -1
View File
@@ -4336,7 +4336,7 @@ UINT32 EditScreenHandle( void )
//Calculate general mouse information
GetMouseXY( &sGridX, &sGridY );
iMapIndex = sGridY * WORLD_COLS + sGridX;
iMapIndex = (INT32)sGridY * WORLD_COLS + sGridX;
DetermineUndoState();