Skip to content

Commit

Permalink
Check for nullptr (item not in any container)
Browse files Browse the repository at this point in the history
  • Loading branch information
mugling committed Jan 25, 2016
1 parent 6d91e1a commit 3504233
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/item_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class item_location::item_on_person : public item_location::impl {
} else {
// Unpack the object followed by any nested containers starting with the innermost
mv += dynamic_cast<player *>( who )->item_handling_cost( *it );
for( auto obj = who->find_parent( *it ); who->find_parent( *obj ); obj = who->find_parent( *obj ) ) {
for( auto obj = who->find_parent( *it ); obj && who->find_parent( *obj ); obj = who->find_parent( *obj ) ) {
mv += dynamic_cast<player *>( who )->item_handling_cost( *obj );
}
}
Expand Down

0 comments on commit 3504233

Please sign in to comment.