Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAdds survivor utility belt. #8426
Conversation
Rivet-the-Zombie
added some commits
Aug 3, 2014
KA101
self-assigned this
Aug 4, 2014
KA101
merged commit 2ec7561
into
CleverRaven:master
Aug 4, 2014
1 check passed
Rivet-the-Zombie
deleted the
Rivet-the-Zombie:survivor-utility-belt
branch
Aug 4, 2014
BevapDin
reviewed
Aug 4, 2014
| @@ -916,6 +916,7 @@ inventory game::crafting_inventory(player *p) | |||
| crafting_inv.form_from_map(point(p->posx, p->posy), PICKUP_RANGE, false); | |||
| crafting_inv += p->inv; | |||
| crafting_inv += p->weapon; | |||
| crafting_inv += p->worn; | |||
| for (std::vector<item>::const_iterator a = p->worn.begin(); a != p->worn.end(); a++) { | |||
This comment has been minimized.
This comment has been minimized.
BevapDin
Aug 4, 2014
Contributor
You should remove this loop, as all worn items are now in the crafting inventory, but their contents are added (again) in this loop and therefor appear twice.
This comment has been minimized.
This comment has been minimized.
Rivet-the-Zombie
Aug 4, 2014
Author
Member
I hadn't noticed the items' contents to be doubled. The previous system had it so only the contents of worn items would appear in the crafting inventory, but not the worn items themselves.
If I remove p->worn, then a knife in a boot still counts, but not the boot itself. If I were to remove the line after it, would it still count the knife in the boot as well?
This comment has been minimized.
This comment has been minimized.
The whole loop (all 4 lines), and yes boot, knife in boot, holster, gun in holster, gun mod in gun in holster are all counted. The amount_of/has_amount functions check the content of the item recursively. |
Rivet-the-Zombie commentedAug 4, 2014
A wearable collection of tools with a bonus knife sheath!
Includes item, resource-intensive item recipe, survivor zed item drop, and various code to make it all work.