diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-25 20:32:48 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-25 20:32:48 +0000 |
commit | c319b212cbe4a79fdbc4e3efac8530d1e9ffab6f (patch) | |
tree | 62798731b22ab12a1a326b4e04060e5a74b6f879 /crawl-ref/source/player.cc | |
parent | e46965c192b6ddc04357366a2f136d6e2115bb59 (diff) | |
download | crawl-ref-c319b212cbe4a79fdbc4e3efac8530d1e9ffab6f.tar.gz crawl-ref-c319b212cbe4a79fdbc4e3efac8530d1e9ffab6f.zip |
Various cleanups. Also fixed bug 1703500, inventory letters appearing twice
until save/restore.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1371 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 54 |
1 files changed, 18 insertions, 36 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index b6980b4085..048f262a93 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4534,53 +4534,36 @@ void player::init() gift_timeout = 0; - for (int i = 0; i < MAX_NUM_GODS; i++) - { - penance[i] = 0; - worshipped[i] = 0; - num_gifts[i] = 0; - } + penance.init(0); + worshipped.init(0); + num_gifts.init(0); - for (int i = EQ_WEAPON; i < NUM_EQUIP; i++) - equip[i] = -1; - - for (int i = 0; i < 25; i++) - spells[i] = SPELL_NO_SPELL; + equip.init(-1); - for (int i = 0; i < 52; i++) - { - spell_letter_table[i] = -1; - ability_letter_table[i] = ABIL_NON_ABILITY; - } + spells.init(SPELL_NO_SPELL); - for (int i = 0; i < 100; i++) - mutation[i] = 0; + spell_letter_table.init(-1); + ability_letter_table.init(ABIL_NON_ABILITY); - for (int i = 0; i < 100; i++) - demon_pow[i] = 0; + mutation.init(0); + demon_pow.init(0); - for (int i = 0; i < 50; i++) - had_book[i] = 0; + had_book.init(false); - for (int i = 0; i < 50; i++) - unique_items[i] = UNIQ_NOT_EXISTS; + unique_items.init(UNIQ_NOT_EXISTS); for (int i = 0; i < NO_UNRANDARTS; i++) set_unrandart_exist(i, 0); - for (int i = 0; i < 50; i++) - { - skills[i] = 0; - skill_points[i] = 0; - skill_order[i] = MAX_SKILL_ORDER; - practise_skill[i] = 1; - } + skills.init(0); + skill_points.init(0); + skill_order.init(MAX_SKILL_ORDER); + practise_skill.init(true); skill_cost_level = 1; total_skill_points = 0; - for (int i = 0; i < 30; i++) - attribute[i] = 0; + attribute.init(0); for (int i = 0; i < ENDOFPACK; i++) { @@ -4598,8 +4581,7 @@ void player::init() inv[i].link = i; } - for (int i = 0; i < NUM_DURATIONS; i++) - duration[i] = 0; + duration.init(0); exp_available = 25; } @@ -5052,7 +5034,7 @@ void player::heal(int amount, bool max_too) ::inc_hp(amount, max_too); } -int player::holiness() const +mon_holy_type player::holiness() const { if (is_undead) return (MH_UNDEAD); |