From 0e24049ce47360b6e36c5696078446e1f124e551 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 15 Feb 2015 15:22:01 +0100 Subject: [PATCH] torpedo: Suppress bulletin when player torpedoes his own ship Signed-off-by: Markus Armbruster --- src/lib/commands/torp.c | 6 +++--- tests/torpedo/journal.log | 7 +------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/lib/commands/torp.c b/src/lib/commands/torp.c index 49948909b..951c8a37f 100644 --- a/src/lib/commands/torp.c +++ b/src/lib/commands/torp.c @@ -169,13 +169,13 @@ torp(void) vship.shp_x, vship.shp_y)) { pr("BOOM!... Torpedo slams into land before reaching target.\n"); /* We only tell the victim if we were within range. */ - if (vshipown != 0) + if (vshipown != 0 && vshipown != player->cnum) wu(0, vshipown, "Torpedo sighted @ %s by %s\n", xyas(sub.shp_x, sub.shp_y, vshipown), prship(&vship)); } else if (chance(hitchance)) { pr("BOOM!...\n"); - if (vshipown != 0) + if (vshipown != 0 && vshipown != player->cnum) wu(0, vshipown, "%s in %s torpedoed %s for %d damage.\n", sub_mcp->m_flags & M_SUB ? "sub" : prship(&sub), xyas(sub.shp_x, sub.shp_y, vshipown), @@ -195,7 +195,7 @@ torp(void) retreat_ship(&vship, vshipown, 't'); } else { pr("Missed\n"); - if (vshipown != 0) + if (vshipown != 0 && vshipown != player->cnum) wu(0, vshipown, "Torpedo sighted @ %s by %s\n", xyas(sub.shp_x, sub.shp_y, vshipown), prship(&vship)); } diff --git a/tests/torpedo/journal.log b/tests/torpedo/journal.log index 4250f973b..ba3b60b77 100644 --- a/tests/torpedo/journal.log +++ b/tests/torpedo/journal.log @@ -356,7 +356,6 @@ Play#1 output Play#1 1 BOOM!... Play#1 output Play#1 1 Torpedo hit af asw frigate (#16) for 67 damage. Play#1 output Play#1 1 af asw frigate (#16) takes 44 - Play#1 output Play#1 1 You have a new telegram waiting ... Play#1 output Play#1 6 0 529 Play#1 input torp 15 16 Play#1 command torpedo @@ -365,7 +364,6 @@ Play#1 output Play#1 1 Effective torpedo range is 1.0 Play#1 output Play#1 1 Whooosh... Hitchance = 90% Play#1 output Play#1 1 Missed - Play#1 output Play#1 1 You have a new telegram waiting ... Play#1 output Play#1 6 0 526 Play#1 input ctld Play#1 output Play#1 1 Bye-bye @@ -509,10 +507,7 @@ Play#0 output Play#0 6 0 638 Play#0 input read 1 Play#0 command read - Play#0 output Play#0 1 - Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970 - Play#0 output Play#0 1 sub in 2,0 torpedoed af asw frigate (#16) for 67 damage. - Play#0 output Play#0 1 Torpedo sighted @ 2,0 by af asw frigate (#16) + Play#0 output Play#0 1 No telegrams for 1 at the moment... Play#0 output Play#0 6 0 638 Play#0 input read 2 Play#0 command read -- 2.43.0