From 3e238aa49df1209b441034e2921fcc69dd331234 Mon Sep 17 00:00:00 2001 From: Stas Sergeev Date: Tue, 3 Oct 2006 17:19:58 +0000 Subject: [PATCH] Another rollup patch. - fixed manual moving - quick hack to avoid division by zero when calculating game.state.remtime - fixed some problems with sensors() on ncurses - small translation fixes --- po/ru.po | 4 ++-- src/battle.c | 3 ++- src/events.c | 6 ++++-- src/moving.c | 2 +- src/planets.c | 10 ++++++---- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/po/ru.po b/po/ru.po index e4d4a8b..5445d07 100644 --- a/po/ru.po +++ b/po/ru.po @@ -2789,11 +2789,11 @@ msgstr "Отвечайте \"no\" если не знаете:" #: src/reports.c:482 msgid "Time or arrival date? " -msgstr "Время прибытия?" +msgstr "Время прибытия? " #: src/reports.c:489 msgid "We'll never make it, sir." -msgstr "Ни как не получится, сэр." +msgstr "Никак не получится, сэр." #: src/reports.c:498 msgid "Warp factor? " diff --git a/src/battle.c b/src/battle.c index 71a8202..78baae9 100644 --- a/src/battle.c +++ b/src/battle.c @@ -792,7 +792,8 @@ void deadkl(coord w, feature type, coord mv) if ((game.state.remkl + game.state.remcom + game.state.nscrem)==0) return; - game.state.remtime = game.state.remres/(game.state.remkl + 4*game.state.remcom); + game.state.remtime = game.state.remkl + game.state.remcom > 0 ? + game.state.remres/(game.state.remkl + 4*game.state.remcom) : 99; /* Remove enemy ship from arrays describing local conditions */ if (is_scheduled(FCDBAS) && same(game.battle, game.quadrant) && type==IHC) diff --git a/src/events.c b/src/events.c index f47d420..a35c690 100644 --- a/src/events.c +++ b/src/events.c @@ -111,7 +111,8 @@ void events(void) game.state.date = datemin; /* Decrement Federation resources and recompute remaining time */ game.state.remres -= (game.state.remkl+4*game.state.remcom)*xtime; - game.state.remtime = game.state.remres/(game.state.remkl+4*game.state.remcom); + game.state.remtime = game.state.remkl + game.state.remcom > 0 ? + game.state.remres/(game.state.remkl + 4*game.state.remcom) : 99; if (game.state.remtime <=0) { finish(FDEPLETE); return; @@ -528,7 +529,8 @@ void events(void) newkling(++game.klhere); /* recompute time left */ - game.state.remtime = game.state.remres/(game.state.remkl+4*game.state.remcom); + game.state.remtime = game.state.remkl + game.state.remcom > 0 ? + game.state.remres/(game.state.remkl + 4*game.state.remcom) : 99; /* report the disaster if we can */ if (!damaged(DRADIO) || game.condition == docked) { diff --git a/src/moving.c b/src/moving.c index 0c44b99..f8965c2 100644 --- a/src/moving.c +++ b/src/moving.c @@ -325,7 +325,7 @@ static void getcd(bool isprobe, int akey) prout(_("(Manual navigation assumed.)")); else prout(_("(Manual movement assumed.)")); - navmode = automatic; + navmode = manual; break; } } diff --git a/src/planets.c b/src/planets.c index 9441100..e8ead07 100644 --- a/src/planets.c +++ b/src/planets.c @@ -79,14 +79,16 @@ void sensor(void) /* examine planets in this quadrant */ { if (damaged(DSRSENS)) { - prout(_("Short range sensors damaged.")); + if (game.options & OPTION_TTY) + prout(_("Short range sensors damaged.")); return; } - if (!is_valid(game.plnet) && (game.options & OPTION_TTY)) { - prout(_("Spock- \"No planet in this quadrant, Captain.\"")); + if (!is_valid(game.plnet)) { + if (game.options & OPTION_TTY) + prout(_("Spock- \"No planet in this quadrant, Captain.\"")); return; } - if (is_valid(game.plnet) && (game.state.planets[game.iplnet].known == unknown)) { + if (game.state.planets[game.iplnet].known == unknown) { prout(_("Spock- \"Sensor scan for %s-"), cramlc(quadrant, game.quadrant)); skip(1); prout(_(" Planet at %s is of class %s."), -- 2.31.1