src/game/Editor/Edit_Sys.cc
static void PasteStructureCommon(const UINT32 iMapIndex)
{
	if (iMapIndex >= GRIDSIZE) return;

	const INT32 iRandSelIndex = GetRandomSelection();
	if (iRandSelIndex == -1) return;

	AddToUndoList(iMapIndex);

	const UINT16 usUseIndex    = pSelList[iRandSelIndex].usIndex;
	const UINT16 usUseObjIndex = pSelList[iRandSelIndex].uiObject;

	// Check with Structure Database (aka ODB) if we can put the object here!
	const DB_STRUCTURE_REF* const sr = gTileDatabase[gTileTypeStartIndex[usUseObjIndex] + usUseIndex].pDBStructureRef;
	if (!OkayToAddStructureToWorld(iMapIndex, 0, sr, INVALID_STRUCTURE_ID) && sr != NULL) return;

	// Actual structure info is added by the functions below
	AddStructToHead(iMapIndex, gTileTypeStartIndex[usUseObjIndex] + usUseIndex);
}
//	This is the main (common) structure pasting function. The above three wrappers are only required because they
//	each use different selection lists. Other than that, they are COMPLETELY identical.
This is the main (common) structure pasting function. The above three wrappers are only required because they
each use different selection lists. Other than that, they are COMPLETELY identical.
This is the main ( common ) structure pasting function . The above three wrappers are only required because they each use different selection lists . Other than that they are COMPLETELY identical .
static void PasteStructureCommon(const UINT32 iMapIndex)
{
	if (iMapIndex >= GRIDSIZE) return;
	const INT32 iRandSelIndex = GetRandomSelection();
	if (iRandSelIndex == -1) return;
	AddToUndoList(iMapIndex);
	const UINT16 usUseIndex    = pSelList[iRandSelIndex].usIndex;
	const UINT16 usUseObjIndex = pSelList[iRandSelIndex].uiObject;
	const DB_STRUCTURE_REF* const sr = gTileDatabase[gTileTypeStartIndex[usUseObjIndex] + usUseIndex].pDBStructureRef;
	if (!OkayToAddStructureToWorld(iMapIndex, 0, sr, INVALID_STRUCTURE_ID) && sr != NULL) return;
	AddStructToHead(iMapIndex, gTileTypeStartIndex[usUseObjIndex] + usUseIndex);
}
static void PasteStructureCommon ( const UINT32 iMapIndex ) { if ( iMapIndex >= GRIDSIZE ) return ; const INT32 iRandSelIndex = GetRandomSelection ( ) ; if ( iRandSelIndex == -1 ) return ; AddToUndoList ( iMapIndex ) ; const UINT16 usUseIndex = pSelList [ iRandSelIndex ] . usIndex ; const UINT16 usUseObjIndex = pSelList [ iRandSelIndex ] . uiObject ; const DB_STRUCTURE_REF * const sr = gTileDatabase [ gTileTypeStartIndex [ usUseObjIndex ] + usUseIndex ] . pDBStructureRef ; if ( ! OkayToAddStructureToWorld ( iMapIndex , 0 , sr , INVALID_STRUCTURE_ID ) && sr != NULL ) return ; AddStructToHead ( iMapIndex , gTileTypeStartIndex [ usUseObjIndex ] + usUseIndex ) ; }
This is the main (common) structure pasting function.
This is the main ( common ) structure pasting function .
// Check with Structure Database (aka ODB) if we can put the object here! // Actual structure info is added by the functions below