]> git.pond.sub.org Git - empserver/commit
neweff production work: Fix crash for sea sector
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 15 Jan 2021 06:47:59 +0000 (07:47 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jan 2021 07:39:14 +0000 (08:39 +0100)
commit5f3c64c062d9aaf638a595f71a5cb55d89d8520b
tree328cb764f0ece6fe3ab7fea50e2e7771390c79d6
parent223add6a928a95664bbd40f087556157bdd6d7b1
neweff production work: Fix crash for sea sector

The work required for building sea sectors is zero in sect.config.
When a deity runs neweff or production on a sea sector, e.g. with
"neweff *", buildeff() divides by zero.  Same when a player or deity
runs work with an engineer in a sea sector.  Broken in commit
2ffd7b948 "config: Make work to build sectors configurable", v4.4.0

Fix buildeff() to avoid the division.  Change the required work to 100
in sect.config for good measure.

Cover deity use of neweff and production in tests/update.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/global/sect.config
src/lib/update/sect.c
tests/update/01-1
tests/update/99-POGO
tests/update/journal.log
tests/version/journal.log