Skip to content

Commit

Permalink
Fix animal carry volume calculation (#36035)
Browse files Browse the repository at this point in the history
Volume of bag mounted on an animal was counting against storage volume.
E.g. A 20L bag with 80L storage was only actually giving 60L of storage.
  • Loading branch information
Davi-DeGanne authored and kevingranade committed Dec 12, 2019
1 parent ad70eef commit 38a3cdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/activity_item_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ static void pass_to_ownership_handling( item obj, player *p )

static void stash_on_pet( const std::list<item> &items, monster &pet, player *p )
{
units::volume remaining_volume = pet.inv.empty() ? 0_ml : pet.inv.front().get_storage();
// Add volume of the bag itself since it is going to be subtracted later in the for-each loop.
units::volume remaining_volume = pet.inv.empty() ? 0_ml :
pet.inv.front().get_storage() + pet.inv.front().volume();
units::mass remaining_weight = pet.weight_capacity();

for( const auto &it : pet.inv ) {
Expand Down

0 comments on commit 38a3cdc

Please sign in to comment.