From f2bf352e66fbaacfbad772695871309e0a3f6e43 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 3 Mar 2013 07:12:07 +0100 Subject: [PATCH] edit: Don't reprint edited object when done with it Interactive edit prints the edited object, then reads player input. If it gets key and value, it applies them to the object, and repeats. If it gets nothing, it prints the edited object again, and stops. Remove this last print, because it's not really useful. The object is commonly the same after reading input as before. Except when a nation gets updated while "edit c" is waiting for input: then the second print actually reflects the updates. Has always been that way. Signed-off-by: Markus Armbruster --- src/lib/commands/edit.c | 20 +------------ tests/actofgod/journal.log | 61 -------------------------------------- 2 files changed, 1 insertion(+), 80 deletions(-) diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index edd8bc6f..102a86b6 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -152,26 +152,8 @@ edit(void) key = getin(buf, &ptr); if (!key) return RET_SYN; - if (!*key) { - switch (ewhat) { - case 'c': - print_nat(np); - break; - case 'l': - print_sect(§); - break; - case 's': - print_ship(&ship); - break; - case 'u': - print_land(&land); - break; - case 'p': - print_plane(&plane); - break; - } + if (!*key) return RET_OK; - } } else return RET_OK; diff --git a/tests/actofgod/journal.log b/tests/actofgod/journal.log index 6febf338..f6de7309 100644 --- a/tests/actofgod/journal.log +++ b/tests/actofgod/journal.log @@ -769,13 +769,6 @@ Play#0 output Play#0 1 Available workforce of 3,5 changed from 0 to 1 Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input - Play#0 output Play#0 1 Location : 3,5 Distribution sector : 3,5 - Play#0 output Play#0 1 Designation : - New designation : - - Play#0 output Play#0 1 own oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail - Play#0 output Play#0 1 o O e m i g f c u w l x X p t F a - Play#0 output Play#0 1 1 1 0 2 0 0 0 0 0 100 0 0 0 0 0 0 1 - Play#0 output Play#0 1 Mines : 0 - Play#0 output Play#0 1 Road % : 0 Rail % : 0 Defense % : 0 Play#0 output Play#0 6 0 640 Play#0 input edit l 5,5 Play#0 command edit @@ -788,13 +781,6 @@ Play#0 output Play#0 1 Road % : 0 Rail % : 0 Defense % : 0 Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input - Play#0 output Play#0 1 Location : 5,5 Distribution sector : 5,5 - Play#0 output Play#0 1 Designation : - New designation : - - Play#0 output Play#0 1 own oo eff mob min gld frt oil urn wrk lty che ctg plg ptime fall avail - Play#0 output Play#0 1 o O e m i g f c u w l x X p t F a - Play#0 output Play#0 1 1 1 0 0 0 0 0 0 0 100 0 0 0 0 0 0 0 - Play#0 output Play#0 1 Mines : 0 - Play#0 output Play#0 1 Road % : 0 Rail % : 0 Defense % : 0 Play#0 output Play#0 6 0 640 Play#0 input Play#0 output Play#0 6 0 640 @@ -1346,16 +1332,6 @@ Play#0 output Play#0 1 food of cs cargo ship (#0) changed from 0 to 1 Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input - Play#0 output Play#0 1 POGO (#0) cs cargo ship (#0) - Play#0 output Play#0 1 UID : 0 - Play#0 output Play#0 1 Owner : 0 Location : 1,-1 - Play#0 output Play#0 1 Tech : 100 Efficiency : 0 - Play#0 output Play#0 1 Mobility : 2 Fleet : - Play#0 output Play#0 1 Retreat path : '' Retreat Flags : 0 - Play#0 output Play#0 1 Plague Stage : 0 Plague Time : 0 - Play#0 output Play#0 1 civ mil uw food shl gun pet irn dst oil lcm hcm rad - Play#0 output Play#0 1 c m u f s g p i d o l h r - Play#0 output Play#0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 Play#0 output Play#0 6 0 640 Play#0 input edit s 0 Play#0 command edit @@ -1377,16 +1353,6 @@ Play#0 output Play#0 1 Retreat path of cs cargo ship (#0) changed from n to Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input - Play#0 output Play#0 1 POGO (#0) cs cargo ship (#0) - Play#0 output Play#0 1 UID : 0 - Play#0 output Play#0 1 Owner : 0 Location : 1,-1 - Play#0 output Play#0 1 Tech : 100 Efficiency : 0 - Play#0 output Play#0 1 Mobility : 2 Fleet : - Play#0 output Play#0 1 Retreat path : '' Retreat Flags : 0 - Play#0 output Play#0 1 Plague Stage : 0 Plague Time : 0 - Play#0 output Play#0 1 civ mil uw food shl gun pet irn dst oil lcm hcm rad - Play#0 output Play#0 1 c m u f s g p i d o l h r - Play#0 output Play#0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 Play#0 output Play#0 6 0 640 Play#0 input edit p 0 Play#0 command edit @@ -1404,12 +1370,6 @@ Play#0 output Play#0 1 Land unit of f1 Sopwith Camel #0 unchanged Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input - Play#0 output Play#0 1 POGO (#0) f1 Sopwith Camel #0 - Play#0 output Play#0 1 UID : 0 Owner : 0 Location : 1,-1 - Play#0 output Play#0 1 Efficiency : 0 Mobility : 2 - Play#0 output Play#0 1 Tech : 100 Wing : - Play#0 output Play#0 1 Range : 9 Flags : 0 - Play#0 output Play#0 1 Ship : -1 Land Unit : -1 Play#0 output Play#0 6 0 640 Play#0 input edit u 0 Play#0 command edit @@ -1433,18 +1393,6 @@ Play#0 output Play#0 1 Land unit of sup supply #0 unchanged Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input - Play#0 output Play#0 1 POGO (#0) sup supply #0 - Play#0 output Play#0 1 UID : 0 - Play#0 output Play#0 1 Owner : 0 - Play#0 output Play#0 1 Location : 1,-1 - Play#0 output Play#0 1 Efficiency : 0 Mobility : 2 - Play#0 output Play#0 1 Tech : 100 Army : - Play#0 output Play#0 1 Fortification : 0 Land unit : -1 - Play#0 output Play#0 1 Ship : -1 Retreat percentage : 42 - Play#0 output Play#0 1 Retreat path : '' Retreat Flags : 0 - Play#0 output Play#0 1 civ mil uw food shl gun pet irn dst oil lcm hcm rad - Play#0 output Play#0 1 c m u f s g p i d o l h r - Play#0 output Play#0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Play#0 output Play#0 6 0 640 Play#0 input edit c 0 @ 0 Play#0 command edit @@ -1630,15 +1578,6 @@ Play#0 output Play#0 1 Technology of 5 (#5) changed from 0.00 to 1.00 Play#0 output Play#0 4 %c xxxxx -- thing value : Play#0 input - Play#0 output Play#0 1 Country #: 5 - Play#0 output Play#0 1 Name : 5 Representative : 5 - Play#0 output Play#0 1 BTUs : 640 Reserves : 0 - Play#0 output Play#0 1 Capital : 0,0 Origin : 0,0 - Play#0 output Play#0 1 Status : 0x5 Seconds Used : 0 - Play#0 output Play#0 1 Technology : 1.00 Research : 0.00 - Play#0 output Play#0 1 Education : 0.00 Happiness : 0.00 - Play#0 output Play#0 1 Money : $ 0 - Play#0 output Play#0 1 Telegrams : 1 Play#0 output Play#0 6 0 640 Play#0 input read 0 Play#0 command read