mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- 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:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user