summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-06-07 17:49:09 +0200
committerBardur Arantsson <bardur@scientician.net>2015-06-07 17:49:09 +0200
commit82936c32458b8d8312a4fdfce8b2d8274f493872 (patch)
treec893097d1d780703f5580bba206e35d009282a35
parentc3d66ab972b64f824a01529b77c1340c64e36f35 (diff)
Remove prompt_pickup_heavy option; behave as if always set
-rw-r--r--src/object1.cc49
-rw-r--r--src/options.cc1
-rw-r--r--src/options.hpp1
-rw-r--r--src/tables.cc3
4 files changed, 18 insertions, 36 deletions
diff --git a/src/object1.cc b/src/object1.cc
index fcbc35f8..ccfd5ac5 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -5999,44 +5999,31 @@ void pickup_ammo()
}
-/*
- * Make the player carry everything in a grid
- *
- * If "pickup" is FALSE then only gold will be picked up
- *
- * This is called by py_pickup() when easy_floor is TRUE.
+/**
+ * Check for encumberance if player were to pick up
+ * given item.
*/
-bool_ can_carry_heavy(object_type *o_ptr)
+static bool can_carry_heavy(object_type const *o_ptr)
{
- /* Query if object is heavy */
- if (prompt_pickup_heavy)
- {
- int i, j;
- int old_enc = 0;
- int new_enc = 0;
-
- /* Extract the "weight limit" (in tenth pounds) */
- i = weight_limit();
+ /* Extract the "weight limit" (in tenth pounds) */
+ int i = weight_limit();
- /* Calculate current encumbarance */
- j = calc_total_weight();
+ /* Calculate current encumbarance */
+ int j = calc_total_weight();
- /* Apply encumbarance from weight */
- if (j > i / 2) old_enc = ((j - (i / 2)) / (i / 10));
+ /* Apply encumbarance from weight */
+ int old_enc = 0;
+ if (j > i / 2) old_enc = ((j - (i / 2)) / (i / 10));
- /* Increase the weight, recalculate encumbarance */
- j += (o_ptr->number * o_ptr->weight);
+ /* Increase the weight, recalculate encumbarance */
+ j += (o_ptr->number * o_ptr->weight);
- /* Apply encumbarance from weight */
- if (j > i / 2) new_enc = ((j - (i / 2)) / (i / 10));
+ /* Apply encumbarance from weight */
+ int new_enc = 0;
+ if (j > i / 2) new_enc = ((j - (i / 2)) / (i / 10));
- /* Should we query? */
- if (new_enc > old_enc)
- {
- return (FALSE);
- }
- }
- return (TRUE);
+ /* If the encumberance is the same, then we pick up without prompt */
+ return (new_enc <= old_enc);
}
/* Do the actuall picking up */
diff --git a/src/options.cc b/src/options.cc
index 0e3df5d0..1a12fc56 100644
--- a/src/options.cc
+++ b/src/options.cc
@@ -8,7 +8,6 @@ bool_ quick_messages; /* Activate quick messages */
bool_ carry_query_flag; /* Prompt before picking things up */
bool_ use_old_target; /* Use old target by default */
bool_ always_pickup; /* Pick things up by default */
-bool_ prompt_pickup_heavy; /* Don't pick up the corpses */
bool_ always_repeat; /* Repeat obvious commands */
bool_ ring_bell; /* Ring the bell (on errors, etc) */
diff --git a/src/options.hpp b/src/options.hpp
index 2035d4d8..39757c83 100644
--- a/src/options.hpp
+++ b/src/options.hpp
@@ -10,7 +10,6 @@ extern bool_ quick_messages;
extern bool_ carry_query_flag;
extern bool_ use_old_target;
extern bool_ always_pickup;
-extern bool_ prompt_pickup_heavy;
extern bool_ always_repeat;
extern bool_ ring_bell;
diff --git a/src/tables.cc b/src/tables.cc
index 6796df31..19e705c3 100644
--- a/src/tables.cc
+++ b/src/tables.cc
@@ -1291,9 +1291,6 @@ option_type option_info[] =
{ &always_pickup, FALSE, 1, 5,
"always_pickup", "Pick things up by default" },
- { &prompt_pickup_heavy, TRUE, 1, 6,
- "prompt_pickup_heavy", "Prompt before picking up heavy objects" },
-
{ &always_repeat, TRUE, 1, 7,
"always_repeat", "Repeat obvious commands" },