update/revolt: Fix land unit casualties

Fix the bug demonstrated by the previous commit:
take_casualties_from_lands() limits total casualties to @each.  It
should limit each land unit's casualties, and only if !may_kill.  This
can lead to fewer casualties than called for; oops in
take_casualties().  Broken in commit 025e9cc25, v4.4.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2018-04-10 16:31:11 +02:00
parent d111522fe8
commit 60429028e7
4 changed files with 16 additions and 16 deletions

View file

@ -378,9 +378,9 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship h
22 0 -14 -8 2 0 0 1 50 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 10 0 0 0 0 0 healthy 0 -1 0
23 0 -14 -8 2 0 0 1 50 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 10 0 0 0 0 0 healthy 0 -1 0
24 4 -12 -8 8 100 60 0 170 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
25 0 -12 -8 20 0 -44 1 170 0 0 none 0 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 8 0 0 0 0 0 healthy 0 -1 0
25 0 -12 -8 20 0 -45 1 170 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 8 0 0 0 0 0 healthy 0 -1 0
26 0 -12 -8 2 0 -2 1 50 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 10 0 0 0 0 0 healthy 0 -1 0
27 0 -12 -8 20 0 0 1 170 0 0 none 0 "" -1 0 42 () "" 0 10 0 0 0 0 0 0 10 0 0 0 0 0 healthy 0 -1 0
27 0 -12 -8 20 0 -10 0 170 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 10 0 0 0 0 0 healthy 0 -1 0
28 0 -8 -8 1 0 -12 0 50 0 0 none 0 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 9 0 0 0 0 0 healthy 0 -1 0
29 4 -6 -8 2 14 47 0 50 0 0 none 0 "" -1 0 42 () "" 0 24 0 0 0 0 0 0 8 0 0 0 0 0 healthy 0 -1 0
30 2 -16 0 2 88 60 0 50 0 0 none 0 "" -1 0 42 () "" 0 100 0 0 0 0 0 0 7 0 0 0 0 0 healthy 0 -1 0
@ -463,10 +463,10 @@ timestamp owner type id x y
0 4 3 21 -14 -8
0 4 3 22 -14 -8
0 4 3 23 -14 -8
0 4 3 27 -12 -8
0 4 0 0 -12 -8
0 4 3 25 -12 -8
0 4 3 26 -12 -8
0 4 3 27 -12 -8
0 4 3 28 -8 -8
0 4 0 0 -16 -6
0 4 0 0 -8 -6

View file

@ -1364,11 +1364,11 @@
Play#0 output Play#0 1 rebels murder 2 military
Play#0 output Play#0 1 Partisans take over -14,-8!
Play#0 output Play#0 1 sec security #25 kills 4 guerrillas in raid at -12,-8!
Play#0 output Play#0 1 sec security #27 dies fighting guerrillas in -12,-8
Play#0 output Play#0 1 sec security #25 blown up by the crew when POGO took -12,-8!
Play#0 output Play#0 1 inf infantry #26 captured when POGO took -12,-8!
Play#0 output Play#0 1 sec security #27 blown up by the crew when POGO took -12,-8!
Play#0 output Play#0 1 Guerrilla warfare in -12,-8
Play#0 output Play#0 1 rebels murder 59 military
Play#0 output Play#0 1 rebels murder 70 military
Play#0 output Play#0 1 Partisans take over -12,-8!
Play#0 output Play#0 1 Guerrilla warfare in -10,-8
Play#0 output Play#0 1 body count: troops: 10, rebels: 5

View file

@ -39,8 +39,6 @@ tester@127.0.0.1 logged in as country #0
Triggering unscheduled update
production update (60 ETUs)
preparing sectors...
Oops: taken < mc in ../src/lib/update/revolt.c:471
Crash dump complete
done preparing sectors.
producing for countries...
done producing for countries.