Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Template for new versions:

## Fixes
- `getplants`: will no longer crash when faced with plants with growths that do not drop seeds when processed
- `gui/teleport`: adapt to new behavior in DF 51.11 to avoid a crash when teleporting items into mid-air

## Misc Improvements
- All places where units are listed in DFHack tools now show the translated English name in addition to the native name. In particular, this makes units searchable by English name in `gui/sitemap`.
Expand Down
9 changes: 6 additions & 3 deletions library/modules/Items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,12 @@ static bool detachItem(df::item *item)
}
}

if (auto ref = virtual_cast<df::general_ref_projectile>(Items::getGeneralRef(item, general_ref_type::PROJECTILE)))
return linked_list_remove(&world->projectiles.all, ref->projectile_id)
&& removeRef(item->general_refs, general_ref_type::PROJECTILE, ref->getID());
if (auto ref = virtual_cast<df::general_ref_projectile>(Items::getGeneralRef(item, general_ref_type::PROJECTILE))) {
auto proj_id = ref->projectile_id;
bool isRefRemoved = removeRef(item->general_refs, general_ref_type::PROJECTILE, proj_id);
bool isLinkRemoved = linked_list_remove(&world->projectiles.all, proj_id);
return isRefRemoved && isLinkRemoved;
}

if (item->flags.bits.on_ground) {
if (!removeItemOnGround(item))
Expand Down