diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-24 12:42:13 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-24 14:31:30 +0200 |
commit | 394fb595f6d03fa9d266ed28726975e0b59bc798 (patch) | |
tree | 3a84b6c9ced49b07af9212a3447770ae53897ed5 /crawl-ref/source/itemname.cc | |
parent | ea81f9787b7cba7a18ec7c098fcd0fe37fe7daef (diff) | |
download | crawl-ref-394fb595f6d03fa9d266ed28726975e0b59bc798.tar.gz crawl-ref-394fb595f6d03fa9d266ed28726975e0b59bc798.zip |
Extract newgame character restrictions from newgame.cc.
The functions in the new ng-restr.cc are "pure": They don't
access global state; data is passed in via the new and
incomplete newgame_def.
Eventually, new_game should be split into something like
newgame_def choose_game();
that doesn't access "you", and
void setup_game(newgame_def);
that sets up the player.
Also get rid of player_size in favour of player::body_size. Rename
player_size_type to size_part_type since it's not really
player-specific (used in actor::body_size). Move parts of
player_genus, player::has_claws, body_size out into species.cc.
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index d87c786bb8..2b99f39f1d 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2502,7 +2502,7 @@ bool is_useless_item(const item_def &item, bool temp) switch (item.base_type) { case OBJ_WEAPONS: - if (!check_weapon_wieldable_size(item, player_size(PSIZE_BODY, !temp)) + if (!check_weapon_wieldable_size(item, you.body_size(PSIZE_BODY, !temp)) && !is_throwable(&you, item)) { // Weapon is too large (or small) to be wielded and cannot be @@ -2528,11 +2528,11 @@ bool is_useless_item(const item_def &item, bool temp) switch (item.sub_type) { case MI_LARGE_ROCK: - return (player_size(PSIZE_BODY, !temp) < SIZE_LARGE + return (you.body_size(PSIZE_BODY, !temp) < SIZE_LARGE || !you.can_throw_large_rocks()); case MI_JAVELIN: case MI_THROWING_NET: - return (player_size(PSIZE_BODY, !temp) < SIZE_MEDIUM); + return (you.body_size(PSIZE_BODY, !temp) < SIZE_MEDIUM); } return (false); |