]> git.pond.sub.org Git - empserver/commitdiff
torpedo: Suppress bulletin when player torpedoes his own ship
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 15 Feb 2015 14:22:01 +0000 (15:22 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:52 +0000 (08:20 +0100)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/torp.c
tests/torpedo/journal.log

index 49948909bdb2d8e87328087c2ea73f3d21b1af5d..951c8a37fcae606d0da7252d600e84f64a1b3bdb 100644 (file)
@@ -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));
        }
index 4250f973bd2fda58fa595d84be40ef7b9be02127..ba3b60b7798507149e679735483f02efff5fac7c 100644 (file)
     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
     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
     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