From 148af51ab3be07e837be337b70938f32ef9212aa Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 10 Jan 2015 14:16:00 +0100 Subject: [PATCH] retreat lretreat: Deprecate pseudo-condition 'c' It's redundant; retreat path 'h' cancels orders just fine. Document that instead. 'c' still works, and I don't plan to break it as long as it doesn't get in the way, which seems unlikely. Signed-off-by: Markus Armbruster --- info/lretreat.t | 7 +++++-- info/retreat.t | 7 +++++-- src/lib/commands/retr.c | 5 +++-- tests/retreat/journal.log | 2 -- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/info/lretreat.t b/info/lretreat.t index 8037f5df3..aafeefe4f 100644 --- a/info/lretreat.t +++ b/info/lretreat.t @@ -4,12 +4,16 @@ .SY "lretreat " .SY "lretreat q" The lretreat command allows you to examine or modify the retreat -paths and conditions of your land units. +orders of your land units. .s1 The first argument selects land units to view or give orders for. If an army designation is given when specifying orders, the orders apply to all members of that army. .s1 +Retreat orders consist of a retreat path and conditions. +.s1 +A retreat path 'h' orders the ships not to retreat. +.s1 With 'q' instead of a retreat path, the current retreat paths and conditions will be listed. The report format contains the following fields: @@ -66,7 +70,6 @@ Retreat conditions are: when it is fired upon, and no friendly units/sectors (including the unit itself) are able to fire back at the aggressor. - c Cancel retreat order .fi .s1 For example, if the cavalry above was fired at, it would attempt to diff --git a/info/retreat.t b/info/retreat.t index a445aa99d..320022890 100644 --- a/info/retreat.t +++ b/info/retreat.t @@ -4,12 +4,16 @@ .SY "retreat " .SY "retreat q" The retreat command allows you to examine or modify the retreat -paths and conditions of your ships. +orders of your ships .s1 The first argument selects ships to view or give orders for. If a fleet designation is given when specifying orders, the orders apply to all members of that fleet. .s1 +Retreat orders consist of a retreat path and conditions. +.s1 +A retreat path 'h' orders the ships not to retreat. +.s1 With 'q' instead of a retreat path, the current retreat paths and conditions will be listed. The report format contains the following fields: @@ -71,7 +75,6 @@ Retreat conditions are: ships/sectors (including the ship itself) are able to fire back at the aggressor u Retreat upon a failed boarding attempt - c Cancel retreat order .fi .s1 For example, if the battleship above was fired at, it would attempt to diff --git a/src/lib/commands/retr.c b/src/lib/commands/retr.c index 0a81581f5..2504da505 100644 --- a/src/lib/commands/retr.c +++ b/src/lib/commands/retr.c @@ -114,7 +114,8 @@ retreat(int type) } for (i--; i >= 0 && pq[i] == dirch[DIR_STOP]; i--) pq[i] = 0; - + } + if (pq && *pq) { again: fl = getstarg(player->argp[3], "Retreat conditions ('?' to list available ones)? ", @@ -125,6 +126,7 @@ retreat(int type) for (i = 0; fl[i]; i++) { ch = tolower(fl[i]); if (ch == 'c') { + /* Deprecated, but keeping it around doesn't hurt */ *pq = 0; break; } @@ -135,7 +137,6 @@ retreat(int type) rflagsc[j], symbol_by_value(1 << j, retreat_flags)); } - pr("c\tcancel retreat order\n"); goto again; } p = strchr(rflagsc, ch); diff --git a/tests/retreat/journal.log b/tests/retreat/journal.log index dfd7a8aff..f084bbe12 100644 --- a/tests/retreat/journal.log +++ b/tests/retreat/journal.log @@ -43,7 +43,6 @@ Play#1 output Play#1 1 b retreat when bombed Play#1 output Play#1 1 d retreat when depth-charged Play#1 output Play#1 1 u retreat when boarded - Play#1 output Play#1 1 c cancel retreat order Play#1 output Play#1 4 Retreat conditions ('?' to list available ones)? Play#1 input junk Play#1 output Play#1 1 Bad retreat condition 'j' @@ -109,7 +108,6 @@ Play#1 output Play#1 1 i retreat when injured Play#1 output Play#1 1 h retreat when helpless Play#1 output Play#1 1 b retreat when bombed - Play#1 output Play#1 1 c cancel retreat order Play#1 output Play#1 4 Retreat conditions ('?' to list available ones)? Play#1 input junk Play#1 output Play#1 1 Bad retreat condition 'j' -- 2.43.0