From 2ec20c88965ac003d65e0c99fce286641fbe2238 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 26 Aug 2008 21:33:48 -0400 Subject: [PATCH] Include destination in interception and plane mission messages Interception and missions launch planes automatically. The plane owner (and for missions, the base sector owner) gets a message. Destination coordinates are often obvious from the context, but not always, e.g. when flying in support of allies, or when the mission gets interepted and aborts. Include the destination coordinates in the messages. Reported by Ulrich Hannemann. --- src/lib/subs/aircombat.c | 9 +++++---- src/lib/subs/mission.c | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/lib/subs/aircombat.c b/src/lib/subs/aircombat.c index 11616ee91..3e396c966 100644 --- a/src/lib/subs/aircombat.c +++ b/src/lib/subs/aircombat.c @@ -415,8 +415,8 @@ sam_intercept(struct emp_qelem *att_list, struct emp_qelem *def_list, if (first) { first = 0; PR(plane_owner, "%s launches SAMs!\n", cname(def_own)); - PR(def_own, "Launching SAMs at %s planes!\n", - cname(plane_owner)); + PR(def_own, "Launching SAMs at %s planes over %s!\n", + cname(plane_owner), xyas(x, y, def_own)); ac_combat_headers(plane_owner, def_own); } ac_dog(aplp, dplp); @@ -497,8 +497,9 @@ ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list, return; PR(plane_owner, "%d %s fighter%s rising to intercept!\n", icount, cname(def_own), icount == 1 ? " is" : "s are"); - PR(def_own, "%d fighter%s intercepting %s planes!\n", - icount, icount == 1 ? " is" : "s are", cname(plane_owner)); + PR(def_own, "%d fighter%s intercepting %s planes over %s!\n", + icount, icount == 1 ? " is" : "s are", cname(plane_owner), + xyas(x, y, def_own)); ac_combat_headers(plane_owner, def_own); ac_airtoair(esc_list, &int_list); ac_airtoair(bomb_list, &int_list); diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index 54d22a78b..6bacf228d 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -647,12 +647,15 @@ perform_mission(coord x, coord y, natid victim, struct emp_qelem *list, pp = BestAirPath(buf, air->x, air->y, x, y); if (CANT_HAPPEN(!pp)) continue; - wu(0, plane_owner, "Flying %s mission from %s\n", - mission_name(mission), xyas(air->x, air->y, plane_owner)); + wu(0, plane_owner, "Flying %s mission from %s to %s\n", + mission_name(mission), + xyas(air->x, air->y, plane_owner), + xyas(x, y, plane_owner)); if (air->own && (air->own != plane_owner)) { - wu(0, air->own, "%s is flying %s mission from %s\n", + wu(0, air->own, "%s is flying %s mission from %s to %s\n", cname(plane_owner), mission_name(mission), - xyas(air->x, air->y, air->own)); + xyas(air->x, air->y, air->own), + xyas(x, y, air->own)); } ac_encounter(&b, &e, air->x, air->y, pp, mission_flags, 0); @@ -1369,12 +1372,15 @@ air_defense(coord x, coord y, natid victim, struct emp_qelem *bomb_list, pln_put(&i); continue; } - wu(0, cn, "Flying %s mission from %s\n", - mission_name(MI_AIR_DEFENSE), xyas(air->x, air->y, cn)); + wu(0, cn, "Flying %s mission from %s to %s\n", + mission_name(MI_AIR_DEFENSE), + xyas(air->x, air->y, cn), + xyas(x, y, cn)); if (air->own && (air->own != cn)) { - wu(0, air->own, "%s is flying %s mission from %s\n", + wu(0, air->own, "%s is flying %s mission from %s to %s\n", cname(cn), mission_name(MI_AIR_DEFENSE), - xyas(air->x, air->y, air->own)); + xyas(air->x, air->y, air->own), + xyas(x, y, air->own)); } /* Now, fly the planes to the sector */ -- 2.43.0