Skip to content

Commit

Permalink
fix: inventories not saving locations properly when removing things (#…
Browse files Browse the repository at this point in the history
…5839)

* Fix location vectors not saving locs properly

* style(autofix.ci): automated formatting

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
joveeater and autofix-ci[bot] authored Dec 27, 2024
1 parent 0c8a2f2 commit 0bb35ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/visitable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ void location_visitable<location_inventory>::remove_items_with( const

for( auto istack_iter = istack.begin(); istack_iter != istack.end() &&
last != VisitResponse::ABORT; ) {

location<item> *saved_loc = ( *istack_iter )->loc;
( *istack_iter )->remove_location();
detached_ptr<item> t( *istack_iter );

Expand All @@ -747,7 +747,7 @@ void location_visitable<location_inventory>::remove_items_with( const

if( t ) {
t.release();
( *istack_iter )->set_location( &*inv->loc );
( *istack_iter )->set_location( saved_loc );
istack_iter++;
}
}
Expand Down

0 comments on commit 0bb35ba

Please sign in to comment.