Spies shot were only deduced from sector military; land units were
immune to losses; in fact they needn't have any military to spy.
Fix by requiring and using only sector military. Closes#758483.
Make spy() not skip sectors without civilians, military and land
units. There could be other interesting things to report there:
efficiency, gold bars, planes...
The values in these columns were computed by count_sect_units() and
count_sect_planes(), which included land units and planes in the count
that aren't shown by prunits() and prplanes(), namely own and embarked
units. Confusing. Moreover, count_sect_planes() and prunits() rolled
dice separately for spy units. This could leak the presence of spies
even when prunits() didn't show them.
All fixable, but not worth the trouble; just remove the counts.
other. Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special). New header types.h to
help avoid inclusion cycles. Sort include directives. Remove some
superflous includes.
format.
(prplanes): Fix dangerous misuse of pr(): passed formatted string
instead of format string and arguments. Crash bug if formatted string
contains '%'. Players can put that in country names...
of copies made by getvec(). This is safe, because the old code made
single copies and always flushed them back into the unit structures
before flushing those.
effect. Replace calls by struct assignment where possible. Replace
clear buffer, copy string to buffer by strncpy(). Use assignment to
clear when that's clearer. Replace overlapping copy through bounce
buffer by memmove(). Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.