|
|
|
@ -832,23 +832,12 @@ static bool detachItem(MapExtras::MapCache &mc, df::item *item)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
df::proj_list_link *link = world->proj_list.next;
|
|
|
|
|
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());
|
|
|
|
|
return linked_list_remove(&world->proj_list, ref->projectile_id) &&
|
|
|
|
|
DFHack::removeRef(item->general_refs,
|
|
|
|
|
general_ref_type::PROJECTILE, ref->getID());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item->flags.bits.on_ground)
|
|
|
|
|