diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-24 06:44:51 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-24 06:44:51 +0000 |
commit | 7e0d56433b95ea95b2cc06dfbc98d7887a50b968 (patch) | |
tree | 6154bf07ecc9dec4a0eb05d5a3d235f05b587038 /crawl-ref/source/acr.cc | |
parent | 27a42940bf6942306c74fa5a52abcf1e69e56b1d (diff) | |
download | crawl-ref-7e0d56433b95ea95b2cc06dfbc98d7887a50b968.tar.gz crawl-ref-7e0d56433b95ea95b2cc06dfbc98d7887a50b968.zip |
When changing dungeon features with a wizard command use
dungeon_terrain_changed() so that events will be fired and the overmap
will get updadated if things like portals or altars are overwritten.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7582 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 370ac47f51..c835f3e781 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -754,7 +754,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) break; case 'p': - grd(you.pos()) = DNGN_ENTER_PANDEMONIUM; + dungeon_terrain_changed(you.pos(), DNGN_ENTER_PANDEMONIUM, false); break; case 'P': @@ -780,7 +780,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) break; } - grd(you.pos()) = DNGN_ENTER_PORTAL_VAULT; + dungeon_terrain_changed(you.pos(), DNGN_ENTER_PORTAL_VAULT, false); map_wiz_props_marker *marker = new map_wiz_props_marker(you.pos()); marker->set_property("dst", dst); marker->set_property("desc", "wizard portal, dest = " + dst); @@ -789,7 +789,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) } case 'l': - grd(you.pos()) = DNGN_ENTER_LABYRINTH; + dungeon_terrain_changed(you.pos(), DNGN_ENTER_LABYRINTH, false); break; case 'k': @@ -877,9 +877,15 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) get_input_line( specs, sizeof( specs ) ); if (specs[0] != '\0') - if (const int feat = atoi(specs)) - grd(you.pos()) = static_cast<dungeon_feature_type>( feat ); - + if (const int feat_num = atoi(specs)) + { + dungeon_feature_type feat = + static_cast<dungeon_feature_type>( feat_num ); + dungeon_terrain_changed(you.pos(), feat, false); +#ifdef USE_TILE + env.tile_flv[you.pos().x][you.pos().y].special = 0; +#endif + } break; case ')': @@ -926,7 +932,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) mprf(MSGCH_DIAGNOSTICS, "Setting (%d,%d) to %s (%d)", you.pos().x, you.pos().y, name.c_str(), feat); - grd(you.pos()) = feat; + dungeon_terrain_changed(you.pos(), feat, false); #ifdef USE_TILE env.tile_flv[you.pos().x][you.pos().y].special = 0; #endif |