there seems to be the problem with dbp, i have developed small duplicate option for my editor, it work good for first and second object type but for third it does everything correctly but it won't assign correct object id
problematic code looks like this
`find free three sided brush id
function FindFree3SidedBrush()
c=12
repeat
inc c
until object exist(c)=0 or c=1012
if c=0 or c=1012
GameDir$=dir exe()
cd GameDir$
WriteWarning("No three sided brush id available")
AddConsoleWarning("No three sided brush id available")
exitfunction
endif
endfunction c
`find free four sided brush id
function FindFree4SidedBrush()
c=1013
repeat
inc c
until object exist(c)=0 or c=101013
if c=0 or c=101013
GameDir$=dir exe()
cd GameDir$
WriteWarning("No four sided brush id available")
AddConsoleWarning("No four sided brush id available")
exitfunction
endif
endfunction c
`find free five sided brush id
function FindFree5SidedBrush()
c=101014
repeat
inc c
until object exist(c)=0 or c=201014
if c=0 or c=201014
GameDir$=dir exe()
cd GameDir$
WriteWarning("No five sided brush id available")
AddConsoleWarning("No five sided brush id available")
exitfunction
endif
endfunction c
`duplicate three sided brush
if selected<1012 or selected=1012
newbrush3=FindFree3SidedBrush()
if newbrush3=0
exitfunction
else
clone object newbrush3,selected
selected=newbrush3
if object exist(newbrush3)=1 then exitfunction
endif
endif
`duplicate four sided brush
if selected>1013 or selected=1013 or selected<101013 or selected=101013
newbrush4=FindFree4SidedBrush()
if newbrush4=0
exitfunction
else
clone object newbrush4,selected
selected=newbrush4
if object exist(newbrush4)=1 then exitfunction
endif
endif
`duplicate five sided brush
if selected>101014 or selected=101014 or selected<201014 or selected=201014
newbrush5=FindFree5SidedBrush()
if newbrush5=0
exitfunction
else
clone object newbrush5,selected
selected=newbrush5
if object exist(newbrush5)=1 then exitfunction
endif
endif
now when i try to duplicate 5 sided brush it gets the id from 4 sided one
does anyone sees the problem, is there any other way to duplicate object?