From 6484e5267864bba926afbc8e7128774095895f67 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sat, 23 Jul 2005 13:44:47 +0000 Subject: [PATCH] (stre): Fix to make it match what happens in attack sequence: land units do not react to a mountain. (stre): Add an empth_yield() per sector to make the server responsive to other players as this command is CPU intensive. --- src/lib/commands/stre.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/commands/stre.c b/src/lib/commands/stre.c index 39f436a7..a188c26a 100644 --- a/src/lib/commands/stre.c +++ b/src/lib/commands/stre.c @@ -86,7 +86,10 @@ stre(void) else pr("%7s", ""); - r_total = att_reacting_units(def, 0, 0, &dummy, 9999999); + if (def->sct_type != SCT_MOUNT) + r_total = att_reacting_units(def, 0, 0, &dummy, 9999999); + else + r_total = 0.0; def->own = 0; eff = att_combat_eff(def); if (sect.sct_own == sect.sct_oldown || player->god) { @@ -105,6 +108,12 @@ stre(void) else pr(" %9s", ""); pr("%9d\n", (int)((dtotal + def->mil + r_total) * eff)); + /* + * This command is quite compute intensive. Yield the + * processor after every sector, to keep the game responsive + * for other players. + */ + empth_yield(); } if (!nsect) { if (player->argp[1])