Skip to content

Commit

Permalink
Reset has_tool and has_component at start of loop so all tools/compon…
Browse files Browse the repository at this point in the history
…ents are checked.
  • Loading branch information
kevingranade committed Feb 17, 2013
1 parent 00a1623 commit 9d4a1f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ bool game::player_can_build(player &p, inventory inv, constructable* con,
for (int j = 0; j < 3; j++) {
if (stage.tools[j].size() > 0) {
tools_required = true;
has_tool = false;
for (int k = 0; k < stage.tools[j].size() && !has_tool; k++) {
if (inv.has_amount(stage.tools[j][k], 1))
has_tool = true;
Expand All @@ -462,6 +463,7 @@ bool game::player_can_build(player &p, inventory inv, constructable* con,
}
if (stage.components[j].size() > 0) {
components_required = true;
has_component = false;
for (int k = 0; k < stage.components[j].size() && !has_component; k++) {
if (( itypes[stage.components[j][k].type]->is_ammo() &&
inv.has_charges(stage.components[j][k].type,
Expand Down

0 comments on commit 9d4a1f2

Please sign in to comment.