diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-01 17:44:09 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-01 17:44:09 +0000 |
commit | bb183e9257bd99caeab9776b3579acf68cb203b1 (patch) | |
tree | ca8904e3d8db4aa6db1991b0ffebdb5d932ea6fe /crawl-ref/source/dungeon.cc | |
parent | e32c3272ea58ddf7bf596bbf0ec5c62ec6c42018 (diff) | |
download | crawl-ref-bb183e9257bd99caeab9776b3579acf68cb203b1.tar.gz crawl-ref-bb183e9257bd99caeab9776b3579acf68cb203b1.zip |
Reworked traps: much much cleaner now. There might be bugs, though.
Traps now remember how much ammo they have. The ammo quantities
(from David) are rather tentative.
Breaks savefiles.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7076 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 6b4bdda1c6..6b024755ea 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -2509,7 +2509,7 @@ static void _place_traps(int level_number) for (int i = 0; i < num_traps; i++) { - trap_struct& ts(env.trap[i]); + trap_def& ts(env.trap[i]); if (ts.type != TRAP_UNASSIGNED) continue; @@ -2540,6 +2540,7 @@ static void _place_traps(int level_number) } } grd(ts.pos) = DNGN_UNDISCOVERED_TRAP; + ts.prepare_ammo(); } } @@ -7296,6 +7297,7 @@ bool place_specific_trap(const coord_def& where, trap_type spec_type) env.trap[tcount].type = spec_type; env.trap[tcount].pos = where; grd(where) = DNGN_UNDISCOVERED_TRAP; + env.trap[tcount].prepare_ammo(); return (true); } |