Delete object is still don't working
Posted: Sat Dec 29, 2012 4:38 pm
I've experimented the following, when removing several objects from the map:
On the example if DeleteObject () is used, in cases where several instances of the object (smoke) are in the same tile, not all are always removed. But, if using SetObjectPosition to put them out of the map then works.
Well, in fact the smoke disappears but the line of see continues to be blocked by the smoke (as it was here yet).
If you keep the shift down over the tile you see the smoke objects are still here even without images.
…
for(i=0;i<999;i++)
{
id = GetObjectFromName("merr_objects", "SMOKE_ALLIED", i) ;
if(id == -1)
{
i = 999 ; // end the loop
}
else
{
SetObjectPosition(id, 0, 0) ;
//DeleteObject(id) ;
}
}
On the example if DeleteObject () is used, in cases where several instances of the object (smoke) are in the same tile, not all are always removed. But, if using SetObjectPosition to put them out of the map then works.
Well, in fact the smoke disappears but the line of see continues to be blocked by the smoke (as it was here yet).
If you keep the shift down over the tile you see the smoke objects are still here even without images.
…
for(i=0;i<999;i++)
{
id = GetObjectFromName("merr_objects", "SMOKE_ALLIED", i) ;
if(id == -1)
{
i = 999 ; // end the loop
}
else
{
SetObjectPosition(id, 0, 0) ;
//DeleteObject(id) ;
}
}