|
|
@ -832,22 +832,11 @@ static bool detachItem(MapExtras::MapCache &mc, df::item *item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (auto *ref =
|
|
|
|
if (auto *ref =
|
|
|
|
virtual_cast<df::general_ref_projectile>(Items::getGeneralRef(item, general_ref_type::PROJECTILE)))
|
|
|
|
virtual_cast<df::general_ref_projectile>(
|
|
|
|
|
|
|
|
Items::getGeneralRef(item, general_ref_type::PROJECTILE)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int32_t proj_id = ((df::general_ref_projectile *)ref)->projectile_id;
|
|
|
|
return linked_list_remove(&world->proj_list, ref->projectile_id) &&
|
|
|
|
df::proj_list_link *link = world->proj_list.next;
|
|
|
|
DFHack::removeRef(item->general_refs,
|
|
|
|
for (; link; link = link->next)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (link->item->id != proj_id)
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
link->prev->next = link->next;
|
|
|
|
|
|
|
|
if (link->next)
|
|
|
|
|
|
|
|
link->next->prev = link->prev;
|
|
|
|
|
|
|
|
delete(link);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return DFHack::removeRef(item->general_refs,
|
|
|
|
|
|
|
|
general_ref_type::PROJECTILE, ref->getID());
|
|
|
|
general_ref_type::PROJECTILE, ref->getID());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|