Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds survivor utility belt. #8426

Merged
merged 9 commits into from Aug 4, 2014

Conversation

Projects
None yet
3 participants
@Rivet-the-Zombie
Copy link
Member

commented Aug 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.

Rivet-the-Zombie added some commits Aug 3, 2014

Fix to allow the player to use worn items in recipes.
No more having to take your goggles off in order to 'wear' them in a
recipe. I've not found this fix to break anything, so here goes nothing.

@KA101 KA101 self-assigned this Aug 4, 2014

@KA101 KA101 merged commit 2ec7561 into CleverRaven:master Aug 4, 2014

1 check passed

default
Details

@Rivet-the-Zombie Rivet-the-Zombie deleted the Rivet-the-Zombie:survivor-utility-belt branch 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.

Copy link
@BevapDin

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.

Copy link
@Rivet-the-Zombie

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?

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2014

If I were to remove the line after it, would it still count the knife in the boot as well?

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 added a commit to Rivet-the-Zombie/Cataclysm-DDA that referenced this pull request Aug 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.