With this function you can check to see if a DS map is stored at the given position within a DS list. If the given position contains a DS map ID, then the function will return true otherwise it will return false.
NOTE This will only detect maps that were manually marked using the ds_list_mark_as_map function.
ds_list_is_map(id, pos);
Argument | Type | Description |
---|---|---|
id | DS List | The ID of the list to check. |
pos | Real | The position within the list to check. |
var size = ds_list_size(ships);
for (var i = 0; i < size; i++)
{
if (ds_list_is_map(ships, i))
{
ds_map_destroy(ships[| i]);
}
}
ds_list_destroy(ships);
The above code loops through a DS list and checks to see if any of the entries contain map IDs. If they do, then these maps are destroyed, and then the main list is destroyed after the loop is finished.