From 85e282c81b99e4c0a1f6433a25a55179f8481b0d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 29 Dec 2008 19:27:55 +0000 Subject: * Also describe enchantment limits for weapons (+9, right?), missiles, and armour (+5 for body armour and bardings, else +2). Tidied up the code a bit. * Prettify waypoint messages as suggested by slinkies in FR 2329972. (I really should reread those tracker items before starting to code them...) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8021 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/travel.cc | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/travel.cc') diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 4bf3c08b97..b8dff8d1f2 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -3753,7 +3753,10 @@ void TravelCache::add_waypoint(int x, int y) } if (keyin < '0' || keyin > '9') + { + canned_msg(MSG_OK); return; + } int waynum = keyin - '0'; @@ -3764,11 +3767,29 @@ void TravelCache::add_waypoint(int x, int y) const level_id &lid = level_id::current(); const bool overwrite = waypoints[waynum].is_valid(); + + std::string old_dest = + overwrite ? get_trans_travel_dest(waypoints[waynum], false, true) : ""; + level_id old_lid = (overwrite ? waypoints[waynum].id : lid); + waypoints[waynum].id = lid; waypoints[waynum].pos = pos; - mprf("%s waypoint %d to your current position.", - overwrite ? "Reset" : "Set new", waynum); + std::string new_dest = get_trans_travel_dest(waypoints[waynum], + false, true); + mesclr(); + if (overwrite) + { + if (lid == old_lid) // same level + mprf("Waypoint %d re-assigned to your current position.", waynum); + else + { + mprf("Waypoint %d re-assigned from %s to %s.", + waynum, old_dest.c_str(), new_dest.c_str()); + } + } + else + mprf("Waypoint %d assigned to %s.", waynum, new_dest.c_str()); update_waypoints(); } -- cgit v1.2.3-54-g00ecf