]> git.pond.sub.org Git - empserver/commitdiff
edit: Don't reprint edited object when done with it
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 3 Mar 2013 06:12:07 +0000 (07:12 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:55:02 +0000 (19:55 +0200)
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 <armbru@pond.sub.org>
src/lib/commands/edit.c
tests/actofgod/journal.log

index edd8bc6fc04ff3e05c69733ec15da6e26d7d48af..102a86b675a01bc10dbabed106c3e15879ace4f4 100644 (file)
@@ -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(&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;
 
index 6febf33827e03adf3e06731213c8fcc084770ff2..f6de7309708672a75afa80e23ef56c1efff5f898 100644 (file)
     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 <L>: 3,5   Distribution sector <D>: 3,5
-    Play#0 output Play#0 1 Designation <s>: -  New designation <S>: -
-    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 <M>: 0
-    Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
     Play#0 output Play#0 6 0 640
     Play#0 input edit l 5,5
     Play#0 command edit
     Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
     Play#0 output Play#0 4 %c xxxxx -- thing value : 
     Play#0 input  
-    Play#0 output Play#0 1 Location <L>: 5,5   Distribution sector <D>: 5,5
-    Play#0 output Play#0 1 Designation <s>: -  New designation <S>: -
-    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 <M>: 0
-    Play#0 output Play#0 1 Road % <R>: 0       Rail % <r>: 0   Defense % <d>: 0
     Play#0 output Play#0 6 0 640
     Play#0 input 
     Play#0 output Play#0 6 0 640
     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 <U>: 0
-    Play#0 output Play#0 1 Owner <O>: 0                        Location <L>: 1,-1
-    Play#0 output Play#0 1 Tech <T>: 100                       Efficiency <E>: 0
-    Play#0 output Play#0 1 Mobility <M>: 2             Fleet <F>: 
-    Play#0 output Play#0 1 Retreat path <R>: ''                Retreat Flags <W>: 0
-    Play#0 output Play#0 1 Plague Stage <a>: 0         Plague Time <b>: 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
     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 <U>: 0
-    Play#0 output Play#0 1 Owner <O>: 0                        Location <L>: 1,-1
-    Play#0 output Play#0 1 Tech <T>: 100                       Efficiency <E>: 0
-    Play#0 output Play#0 1 Mobility <M>: 2             Fleet <F>: 
-    Play#0 output Play#0 1 Retreat path <R>: ''                Retreat Flags <W>: 0
-    Play#0 output Play#0 1 Plague Stage <a>: 0         Plague Time <b>: 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
     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 <U>: 0          Owner <O>: 0            Location <l>: 1,-1
-    Play#0 output Play#0 1 Efficiency <e>: 0   Mobility <m>: 2
-    Play#0 output Play#0 1 Tech <t>: 100               Wing <w>: 
-    Play#0 output Play#0 1 Range <r>: 9                Flags <f>: 0
-    Play#0 output Play#0 1 Ship <s>: -1                Land Unit <y>: -1       
     Play#0 output Play#0 6 0 640
     Play#0 input edit u 0
     Play#0 command edit
     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 <U>: 0
-    Play#0 output Play#0 1 Owner <O>: 0
-    Play#0 output Play#0 1 Location <L>: 1,-1
-    Play#0 output Play#0 1 Efficiency <e>: 0   Mobility <M>: 2
-    Play#0 output Play#0 1 Tech <t>: 100               Army <a>: 
-    Play#0 output Play#0 1 Fortification <F>: 0        Land unit <Y>: -1
-    Play#0 output Play#0 1 Ship <S>: -1                Retreat percentage <Z>: 42
-    Play#0 output Play#0 1 Retreat path <R>: ''                Retreat Flags <W>: 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
     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 <n>: 5                         Representative <r>: 5                   
-    Play#0 output Play#0 1 BTUs <b>: 640                       Reserves <m>:     0
-    Play#0 output Play#0 1 Capital <c>: 0,0            Origin <o>: 0,0
-    Play#0 output Play#0 1 Status <s>: 0x5                     Seconds Used <u>:   0
-    Play#0 output Play#0 1 Technology <T>: 1.00                Research <R>: 0.00
-    Play#0 output Play#0 1 Education <E>: 0.00         Happiness <H>: 0.00
-    Play#0 output Play#0 1 Money <M>: $     0
-    Play#0 output Play#0 1 Telegrams <t>:      1
     Play#0 output Play#0 6 0 640
     Play#0 input read 0
     Play#0 command read