update: Don't let stopped ships produce

Ships fish and drill for oil even when stopped.  Fix that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-21 21:59:30 +02:00
parent f5c9e232e8
commit da14a03231
4 changed files with 13 additions and 15 deletions

View file

@ -126,7 +126,7 @@ upd_ship(struct shpstr *sp, int etus, struct bp *bp, int build)
sectp = getsectp(sp->shp_x, sp->shp_y); sectp = getsectp(sp->shp_x, sp->shp_y);
/* produce oil */ /* produce oil */
if (budget->money >= 0 if (!sp->shp_off && budget->money >= 0
&& (mp->m_flags & M_OIL) && sectp->sct_type == SCT_WATER) { && (mp->m_flags & M_OIL) && sectp->sct_type == SCT_WATER) {
product = &pchr[dchr[SCT_OIL].d_prd]; product = &pchr[dchr[SCT_OIL].d_prd];
oil_gained = roundavg(total_work(100, etus, oil_gained = roundavg(total_work(100, etus,
@ -152,7 +152,7 @@ upd_ship(struct shpstr *sp, int etus, struct bp *bp, int build)
sp->shp_item[I_OIL] += oil_gained; sp->shp_item[I_OIL] += oil_gained;
} }
/* produce fish */ /* produce fish */
if (budget->money >= 0 if (!sp->shp_off && budget->money >= 0
&& (mp->m_flags & M_FOOD) && sectp->sct_type == SCT_WATER) { && (mp->m_flags & M_FOOD) && sectp->sct_type == SCT_WATER) {
sp->shp_item[I_FOOD] sp->shp_item[I_FOOD]
+= roundavg(total_work(100, etus, += roundavg(total_work(100, etus,

View file

@ -127,13 +127,11 @@ read 0
| 100 +40.5f with 100% eff 10 fert | 100 +40.5f with 100% eff 10 fert
| 101 +405f with 100% eff 100 fert | 101 +405f with 100% eff 100 fert
| 102 stopped | 102 stopped
| BUG: produces anyway
| 103 +243f with 60% eff | 103 +243f with 60% eff
| 104 +81f with 20% eff | 104 +81f with 20% eff
| 110 +5.14o 100% eff 10 ocont | 110 +5.14o 100% eff 10 ocont
| 111 +51.4o with 100% eff 100 ocont | 111 +51.4o with 100% eff 100 ocont
| 112 stopped | 112 stopped
| BUG: produces anyway
| 113 +29.0o-29.3o with 60% eff 94-95 ocont | 113 +29.0o-29.3o with 60% eff 94-95 ocont
| 114 +9.2-9.6o with 20% eff 91-93 ocont, 90-93 ocont left | 114 +9.2-9.6o with 20% eff 91-93 ocont, 90-93 ocont left
read 1 read 1

View file

@ -74,7 +74,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
1 14 4 4 39 120 0 0 0 0 0 0 0 14 4 39 0 100 1 4 0 0 0 0 0 1 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0 1 14 4 4 39 120 0 0 0 0 0 0 0 14 4 39 0 100 1 4 0 0 0 0 0 1 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
0 16 4 0 0 0 0 0 0 0 0 0 0 16 4 0 0 100 1 0 0 0 10 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0 0 16 4 0 0 0 0 0 0 0 0 0 0 16 4 0 0 100 1 0 0 0 10 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
0 18 4 0 0 0 0 0 0 0 0 0 0 18 4 0 0 100 1 0 0 0 100 91 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0 0 18 4 0 0 0 0 0 0 0 0 0 0 18 4 0 0 100 1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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
1 -12 4 10 69 120 0 0 0 0 0 0 0 -12 4 1 0 100 0 10 100 0 0 0 0 1 130 1 0 0 0 26 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0 1 -12 4 10 69 120 0 0 0 0 0 0 0 -12 4 1 0 100 0 10 100 0 0 0 0 1 130 1 0 0 0 26 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
@ -319,14 +319,14 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil
97 1 14 6 2 40 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 97 1 14 6 2 40 90 0 20 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
100 1 16 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 38 0 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 100 1 16 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 38 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
101 1 18 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 412 0 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 101 1 18 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 412 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
102 1 20 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 412 0 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 102 1 20 4 0 100 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
103 1 18 4 0 73 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 250 0 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 103 1 18 4 0 73 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 250 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
104 1 18 4 0 33 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 88 0 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 104 1 18 4 0 33 90 0 20 0 0 none 0 "" 100 0 0 0 0 0 0 0 88 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
110 1 16 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 5 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 110 1 16 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 5 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
111 1 18 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 51 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 111 1 18 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 51 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
112 1 20 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 51 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 112 1 20 4 8 100 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 0 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
113 1 18 4 8 65 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 29 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 113 1 18 4 8 65 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 30 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
114 1 18 4 8 25 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 10 0 0 0 0 healthy 0 0 "" 14 6 1 () "" 114 1 18 4 8 25 90 0 50 0 0 none 0 "" 100 0 0 0 0 0 0 0 7 9 0 0 0 0 healthy 0 0 "" 14 6 1 () ""
149 0 0 0 0 0 0 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 0 0 0 () "" 149 0 0 0 0 0 0 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 0 0 0 () ""
/config /config
config plane config plane

View file

@ -794,7 +794,7 @@
Play#0 output Play#0 1 1 97 cs cargo ship 14,6 40% 0 0 0 0 0 0 0 0 90 20 Play#0 output Play#0 1 1 97 cs cargo ship 14,6 40% 0 0 0 0 0 0 0 0 90 20
Play#0 output Play#0 1 1 100 fb fishing boa 16,4 100% 100 0 0 38 0 0 0 0 90 20 Play#0 output Play#0 1 1 100 fb fishing boa 16,4 100% 100 0 0 38 0 0 0 0 90 20
Play#0 output Play#0 1 1 101 fb fishing boa 18,4 100% 100 0 0 412 0 0 0 0 90 20 Play#0 output Play#0 1 1 101 fb fishing boa 18,4 100% 100 0 0 412 0 0 0 0 90 20
Play#0 output Play#0 1 1 102 fb fishing boa 20,4 100% 100 0 0 412 0 0 0 0 90 20 Play#0 output Play#0 1 1 102 fb fishing boa 20,4 100% 100 0 0 7 0 0 0 0 90 20
Play#0 output Play#0 1 1 103 fb fishing boa 18,4 73% 100 0 0 250 0 0 0 0 90 20 Play#0 output Play#0 1 1 103 fb fishing boa 18,4 73% 100 0 0 250 0 0 0 0 90 20
Play#0 output Play#0 1 1 104 fb fishing boa 18,4 33% 100 0 0 88 0 0 0 0 90 20 Play#0 output Play#0 1 1 104 fb fishing boa 18,4 33% 100 0 0 88 0 0 0 0 90 20
Play#0 output Play#0 1 1 110 od oil derrick 16,4 100% 100 0 0 7 0 0 0 0 90 50 Play#0 output Play#0 1 1 110 od oil derrick 16,4 100% 100 0 0 7 0 0 0 0 90 50
@ -834,9 +834,9 @@
Play#0 output Play#0 1 104 fb 18,4 33% 100 0 0 0 0 0 0 0 0 0 0 0 0 Play#0 output Play#0 1 104 fb 18,4 33% 100 0 0 0 0 0 0 0 0 0 0 0 0
Play#0 output Play#0 1 110 od 16,4 100% 100 0 0 0 0 0 0 0 0 5 0 0 0 Play#0 output Play#0 1 110 od 16,4 100% 100 0 0 0 0 0 0 0 0 5 0 0 0
Play#0 output Play#0 1 111 od 18,4 100% 100 0 0 0 0 0 0 0 0 51 0 0 0 Play#0 output Play#0 1 111 od 18,4 100% 100 0 0 0 0 0 0 0 0 51 0 0 0
Play#0 output Play#0 1 112 od 20,4 100% 100 0 0 0 0 0 0 0 0 51 0 0 0 Play#0 output Play#0 1 112 od 20,4 100% 100 0 0 0 0 0 0 0 0 0 0 0 0
Play#0 output Play#0 1 113 od 18,4 65% 100 0 0 0 0 0 0 0 0 29 0 0 0 Play#0 output Play#0 1 113 od 18,4 65% 100 0 0 0 0 0 0 0 0 30 0 0 0
Play#0 output Play#0 1 114 od 18,4 25% 100 0 0 0 0 0 0 0 0 10 0 0 0 Play#0 output Play#0 1 114 od 18,4 25% 100 0 0 0 0 0 0 0 0 9 0 0 0
Play#0 output Play#0 1 30 ships Play#0 output Play#0 1 30 ships
Play#0 output Play#0 6 0 640 Play#0 output Play#0 6 0 640
Play#0 input plane 0:31,0:15 Play#0 input plane 0:31,0:15
@ -1829,7 +1829,7 @@
Play#0 output Play#0 1 1 4,4 a 100% 0 0 100 0 0 Play#0 output Play#0 1 1 4,4 a 100% 0 0 100 0 0
Play#0 output Play#0 1 0 16,4 . 0% 0 0 10 9 0 Play#0 output Play#0 1 0 16,4 . 0% 0 0 10 9 0
Play#0 output Play#0 1 0 18,4 . 0% 0 0 100 91 0 Play#0 output Play#0 1 0 18,4 . 0% 0 0 100 91 0
Play#0 output Play#0 1 0 20,4 . 0% 0 0 100 95 0 Play#0 output Play#0 1 0 20,4 . 0% 0 0 100 100 0
Play#0 output Play#0 1 8 sectors Play#0 output Play#0 1 8 sectors
Play#0 output Play#0 6 0 640 Play#0 output Play#0 6 0 640
Play#0 input reso * ?ocont>0 Play#0 input reso * ?ocont>0
@ -1841,7 +1841,7 @@
Play#0 output Play#0 1 1 10,4 o 100% 0 0 0 92 0 Play#0 output Play#0 1 1 10,4 o 100% 0 0 0 92 0
Play#0 output Play#0 1 0 16,4 . 0% 0 0 10 9 0 Play#0 output Play#0 1 0 16,4 . 0% 0 0 10 9 0
Play#0 output Play#0 1 0 18,4 . 0% 0 0 100 91 0 Play#0 output Play#0 1 0 18,4 . 0% 0 0 100 91 0
Play#0 output Play#0 1 0 20,4 . 0% 0 0 100 95 0 Play#0 output Play#0 1 0 20,4 . 0% 0 0 100 100 0
Play#0 output Play#0 1 5 sectors Play#0 output Play#0 1 5 sectors
Play#0 output Play#0 6 0 640 Play#0 output Play#0 6 0 640
Play#0 input reso * ?uran>0 Play#0 input reso * ?uran>0