Map editor changes from Kriplo (DNL).

Adding roads from “Draw Roads” selection will first remove exact the same road tile object before placing the same again at the same location.  
Adding roads from “Place banks and cliffs” option now will not put same road in same map element just once.  
Whenever you chose to place rocs,bu ches,tree,junk, or any what call PasteStructureCommon() will first remove exact element before it put again.  
“Fill area” will not go to endless recursion loop when try to fill inside buildings, ending with stack overflow.  


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2361 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-09-26 23:41:37 +00:00
parent 6f2af55cba
commit 92b1865817
4 changed files with 17 additions and 3 deletions
+3
View File
@@ -577,6 +577,8 @@ void PasteStructureCommon( UINT32 iMapIndex )
fOkayToAdd = OkayToAddStructureToWorld( (INT16)iMapIndex, 0, gTileDatabase[ (gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) ].pDBStructureRef, INVALID_STRUCTURE_ID );
if ( fOkayToAdd || (gTileDatabase[ (gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) ].pDBStructureRef == NULL) )
{
//dnl Remove existing structure before adding the same, seems to solve problem with stacking but possibly dangerous and completly untested
RemoveStruct( iMapIndex, (UINT16)(gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) );//dnl
// Actual structure info is added by the functions below
AddStructToHead( iMapIndex, (UINT16)(gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) );
// For now, adjust to shadows by a hard-coded amount,
@@ -640,6 +642,7 @@ void PasteBanks( UINT32 iMapIndex, UINT16 usStructIndex , BOOLEAN fReplace)
{
if ( usUseObjIndex == FIRSTROAD )
{
RemoveObject( iMapIndex, (UINT16)( gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex ) );//dnl without this road stacking occur when you holding left mouse key and pasting roads in bank selection
AddObjectToHead( iMapIndex, (UINT16)( gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex ) );
}
else