From cb517c45a1033b22b2eaedadd78e704f23e27173 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 11 Jul 2019 21:02:51 +0200 Subject: [PATCH 1/5] iniparser update from upstream --- iniparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iniparser b/iniparser index 22741d9ce..e3533ac0a 160000 --- a/iniparser +++ b/iniparser @@ -1 +1 @@ -Subproject commit 22741d9ce9d19bf7b5f5a219b6ed0925259a4d1b +Subproject commit e3533ac0a45e43e9716c40f6a874bc6f41ddc96d From 0281ebc44b159178594fa58ea06e8e9c995be529 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 14 Jul 2019 09:26:32 +0200 Subject: [PATCH 2/5] Bug 2596: Crash durch leeres Banner https://bugs.eressea.de/view.php?id=2596 --- res/core/messages.xml | 7 ++++ res/translations/messages.de.po | 3 ++ res/translations/messages.en.po | 3 ++ src/laws.c | 9 +++-- src/laws.test.c | 64 +++++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+), 2 deletions(-) diff --git a/res/core/messages.xml b/res/core/messages.xml index fb6cd45bd..766cd481c 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -4391,6 +4391,13 @@ + + + + + + + diff --git a/res/translations/messages.de.po b/res/translations/messages.de.po index 21586ac31..a1d30c85c 100644 --- a/res/translations/messages.de.po +++ b/res/translations/messages.de.po @@ -689,6 +689,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit kan msgid "error85" msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es wurde keine Emailadresse angegeben.\"" +msgid "error125" +msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es wurde kein Banner angegeben.\"" + msgid "starvation" msgstr "\"$unit($unit) verliert in $region($region) $int($dead) von $int($add($live,$dead)) Personen durch Unterernährung.\"" diff --git a/res/translations/messages.en.po b/res/translations/messages.en.po index 095a83212..037b50d4d 100644 --- a/res/translations/messages.en.po +++ b/res/translations/messages.en.po @@ -689,6 +689,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit cannot msgid "error85" msgstr "\"$unit($unit) in $region($region): '$order($command)' - No email address was supplied.\"" +msgid "error125" +msgstr "\"$unit($unit) in $region($region): '$order($command)' - No banner text was supplied.\"" + msgid "starvation" msgstr "\"$unit($unit) loses $int($dead) of $int($add($live,$dead)) people due to starvation in $region($region).\"" diff --git a/src/laws.c b/src/laws.c index a07c7d517..920de6b03 100644 --- a/src/laws.c +++ b/src/laws.c @@ -2167,8 +2167,13 @@ int banner_cmd(unit * u, struct order *ord) init_order_depr(ord); s = getstrtoken(); - faction_setbanner(u->faction, s); - ADDMSG(&u->faction->msgs, msg_message("changebanner", "value", s)); + if (!s || !s[0]) { + cmistake(u, ord, 125, MSG_EVENT); + } + else { + faction_setbanner(u->faction, s); + ADDMSG(&u->faction->msgs, msg_message("changebanner", "value", s)); + } return 0; } diff --git a/src/laws.test.c b/src/laws.test.c index adda8f5ab..58a6c9a6e 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -1248,6 +1248,68 @@ static void test_ally_cmd_errors(CuTest *tc) { test_teardown(); } +static void test_banner_cmd(CuTest *tc) { + unit *u; + faction *f; + order *ord; + + test_setup(); + mt_create_error(125); + mt_create_va(mt_new("changebanner", NULL), "value:string", MT_NEW_END); + u = test_create_unit(f = test_create_faction(NULL), test_create_region(0, 0, NULL)); + + ord = create_order(K_BANNER, f->locale, "Hodor!"); + banner_cmd(u, ord); + CuAssertStrEquals(tc, "Hodor!", faction_getbanner(f)); + CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "changebanner")); + free_order(ord); + test_clear_messages(f); + + ord = create_order(K_BANNER, f->locale, NULL); + banner_cmd(u, ord); + CuAssertStrEquals(tc, "Hodor!", faction_getbanner(f)); + CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "error125")); + free_order(ord); + test_clear_messages(f); + + test_teardown(); +} + +static void test_email_cmd(CuTest *tc) { + unit *u; + faction *f; + order *ord; + + test_setup(); + mt_create_error(85); + mt_create_va(mt_new("changemail", NULL), "value:string", MT_NEW_END); + mt_create_va(mt_new("changemail_invalid", NULL), "value:string", MT_NEW_END); + u = test_create_unit(f = test_create_faction(NULL), test_create_region(0, 0, NULL)); + + ord = create_order(K_EMAIL, f->locale, "hodor@example.com"); + email_cmd(u, ord); + CuAssertStrEquals(tc, "hodor@example.com", f->email); + CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "changemail")); + free_order(ord); + test_clear_messages(f); + + ord = create_order(K_EMAIL, f->locale, "example.com"); + email_cmd(u, ord); + CuAssertStrEquals(tc, "hodor@example.com", f->email); + CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "changemail_invalid")); + free_order(ord); + test_clear_messages(f); + + ord = create_order(K_EMAIL, f->locale, NULL); + email_cmd(u, ord); + CuAssertStrEquals(tc, "hodor@example.com", f->email); + CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "error85")); + free_order(ord); + test_clear_messages(f); + + test_teardown(); +} + static void test_name_cmd(CuTest *tc) { unit *u; faction *f; @@ -2046,6 +2108,8 @@ CuSuite *get_laws_suite(void) SUITE_ADD_TEST(suite, test_nmr_warnings); SUITE_ADD_TEST(suite, test_ally_cmd); SUITE_ADD_TEST(suite, test_name_cmd); + SUITE_ADD_TEST(suite, test_banner_cmd); + SUITE_ADD_TEST(suite, test_email_cmd); SUITE_ADD_TEST(suite, test_name_cmd_2274); SUITE_ADD_TEST(suite, test_name_unit); SUITE_ADD_TEST(suite, test_name_region); From c70e597b05fc00e1d91f1f3896101a8d73893efe Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 14 Jul 2019 09:37:35 +0200 Subject: [PATCH 3/5] Update copyright notice with current date. --- src/academy.c | 2 +- src/alchemy.c | 2 +- src/attributes/attributes.c | 2 +- src/attributes/dict.c | 2 +- src/attributes/follow.c | 2 +- src/attributes/hate.c | 2 +- src/attributes/iceberg.c | 2 +- src/attributes/key.c | 2 +- src/attributes/movement.c | 2 +- src/attributes/otherfaction.c | 2 +- src/attributes/overrideroads.c | 2 +- src/attributes/racename.c | 2 +- src/attributes/raceprefix.c | 2 +- src/attributes/reduceproduction.c | 2 +- src/attributes/seenspell.c | 3 +-- src/attributes/targetregion.c | 2 +- src/battle.c | 2 +- src/chaos.c | 2 +- src/economy.c | 2 +- src/guard.c | 3 +-- src/items/speedsail.c | 2 +- src/items/weapons.c | 2 +- src/items/xerewards.c | 2 +- src/kernel/attrib.c | 2 +- src/kernel/build.c | 2 +- src/kernel/building.c | 2 +- src/kernel/config.c | 2 +- src/kernel/connection.c | 2 +- src/kernel/curse.c | 2 +- src/kernel/equipment.c | 2 +- src/kernel/event.c | 2 +- src/kernel/faction.c | 2 +- src/kernel/group.c | 2 +- src/kernel/item.c | 2 +- src/kernel/messages.c | 2 +- src/kernel/pathfinder.c | 2 +- src/kernel/plane.c | 2 +- src/kernel/pool.c | 2 +- src/kernel/race.c | 2 +- src/kernel/region.c | 2 +- src/kernel/save.c | 2 +- src/kernel/ship.c | 2 +- src/kernel/skills.c | 2 +- src/kernel/spell.c | 2 +- src/kernel/terrain.c | 2 +- src/kernel/unit.c | 2 +- src/laws.c | 3 +-- src/magic.c | 3 +-- src/main.c | 4 ++-- src/modules/museum.c | 2 +- src/modules/score.c | 2 +- src/monsters.c | 2 +- src/morale.c | 3 +-- src/move.c | 3 +-- src/names.c | 2 +- src/races/dragons.c | 4 +--- src/races/zombies.c | 2 +- src/randenc.c | 2 +- src/report.c | 2 +- src/reports.c | 2 +- src/spells.c | 2 +- src/spells/buildingcurse.c | 2 +- src/spells/regioncurse.c | 2 +- src/spells/shipcurse.c | 2 +- src/spells/unitcurse.c | 2 +- src/spy.c | 2 +- src/steal.c | 3 +-- src/study.c | 2 +- src/teleport.c | 2 +- src/travelthru.c | 2 +- src/triggers/changefaction.c | 2 +- src/triggers/changerace.c | 2 +- src/triggers/clonedied.c | 2 +- src/triggers/createcurse.c | 2 +- src/triggers/createunit.c | 2 +- src/triggers/giveitem.c | 2 +- src/triggers/killunit.c | 2 +- src/triggers/shock.c | 2 +- src/triggers/timeout.c | 2 +- src/triggers/triggers.c | 2 +- src/util/base36.c | 2 +- src/util/functions.c | 2 +- src/util/goodies.c | 2 +- src/util/language.c | 2 +- src/util/lists.c | 2 +- src/util/rand.c | 2 +- src/util/resolve.c | 2 +- src/util/strings.c | 2 +- src/util/umlaut.c | 2 +- src/volcano.c | 2 +- 90 files changed, 91 insertions(+), 100 deletions(-) diff --git a/src/academy.c b/src/academy.c index 01ff9fd1c..c8a7e5a14 100644 --- a/src/academy.c +++ b/src/academy.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/alchemy.c b/src/alchemy.c index b4e7f6253..3d3fe9836 100644 --- a/src/alchemy.c +++ b/src/alchemy.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/attributes.c b/src/attributes/attributes.c index d0be86b0e..2c82603fb 100644 --- a/src/attributes/attributes.c +++ b/src/attributes/attributes.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/dict.c b/src/attributes/dict.c index 130dfffa4..caa7d7e6a 100644 --- a/src/attributes/dict.c +++ b/src/attributes/dict.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/follow.c b/src/attributes/follow.c index caeecee54..c81e5630d 100644 --- a/src/attributes/follow.c +++ b/src/attributes/follow.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/hate.c b/src/attributes/hate.c index cef483cf6..678ee9922 100644 --- a/src/attributes/hate.c +++ b/src/attributes/hate.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/iceberg.c b/src/attributes/iceberg.c index 192ae9032..0c6e4e288 100644 --- a/src/attributes/iceberg.c +++ b/src/attributes/iceberg.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/key.c b/src/attributes/key.c index 8d563024d..10f7c49a9 100644 --- a/src/attributes/key.c +++ b/src/attributes/key.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/movement.c b/src/attributes/movement.c index 01c75ffae..19c5fb774 100644 --- a/src/attributes/movement.c +++ b/src/attributes/movement.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/otherfaction.c b/src/attributes/otherfaction.c index fcf05da05..5f4c83086 100644 --- a/src/attributes/otherfaction.c +++ b/src/attributes/otherfaction.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/overrideroads.c b/src/attributes/overrideroads.c index d96d115d9..8fbd18972 100644 --- a/src/attributes/overrideroads.c +++ b/src/attributes/overrideroads.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/racename.c b/src/attributes/racename.c index 9374f1238..880f32d57 100644 --- a/src/attributes/racename.c +++ b/src/attributes/racename.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/raceprefix.c b/src/attributes/raceprefix.c index 84997b909..68a8923d4 100644 --- a/src/attributes/raceprefix.c +++ b/src/attributes/raceprefix.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/reduceproduction.c b/src/attributes/reduceproduction.c index 0ae0abbea..57bfa4b93 100644 --- a/src/attributes/reduceproduction.c +++ b/src/attributes/reduceproduction.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/seenspell.c b/src/attributes/seenspell.c index 698a83076..442660860 100644 --- a/src/attributes/seenspell.c +++ b/src/attributes/seenspell.c @@ -1,6 +1,5 @@ /* -Copyright (c) 1998-2018, -Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/attributes/targetregion.c b/src/attributes/targetregion.c index 4f5a2101a..2c29f8216 100644 --- a/src/attributes/targetregion.c +++ b/src/attributes/targetregion.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/battle.c b/src/battle.c index 132783ecb..5384d80f5 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/chaos.c b/src/chaos.c index fd87d87d4..26a11b8a2 100644 --- a/src/chaos.c +++ b/src/chaos.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/economy.c b/src/economy.c index efca9ce5c..b7ece1d45 100644 --- a/src/economy.c +++ b/src/economy.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2014, +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/guard.c b/src/guard.c index 437980b34..b27423b2e 100644 --- a/src/guard.c +++ b/src/guard.c @@ -1,6 +1,5 @@ /* -Copyright (c) 1998-2015, -Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/items/speedsail.c b/src/items/speedsail.c index e6d3d1386..69c7deed0 100644 --- a/src/items/speedsail.c +++ b/src/items/speedsail.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/items/weapons.c b/src/items/weapons.c index 040fa0293..bb8191f52 100644 --- a/src/items/weapons.c +++ b/src/items/weapons.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/items/xerewards.c b/src/items/xerewards.c index c49787ec7..78430693c 100644 --- a/src/items/xerewards.c +++ b/src/items/xerewards.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/attrib.c b/src/kernel/attrib.c index 8b3e1c958..7f65e4b73 100644 --- a/src/kernel/attrib.c +++ b/src/kernel/attrib.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/build.c b/src/kernel/build.c index 14d07bb55..271960907 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/building.c b/src/kernel/building.c index 823ad1936..fd81651be 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/config.c b/src/kernel/config.c index 5c0bfc777..f620cb882 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/connection.c b/src/kernel/connection.c index d85f71910..e80294909 100644 --- a/src/kernel/connection.c +++ b/src/kernel/connection.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/curse.c b/src/kernel/curse.c index fbe9ed15d..be7ca4559 100644 --- a/src/kernel/curse.c +++ b/src/kernel/curse.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/equipment.c b/src/kernel/equipment.c index 39e59bf43..4042662c2 100644 --- a/src/kernel/equipment.c +++ b/src/kernel/equipment.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/event.c b/src/kernel/event.c index 9e04abb6a..a20296c57 100644 --- a/src/kernel/event.c +++ b/src/kernel/event.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/faction.c b/src/kernel/faction.c index 460eb519e..3c864e9a8 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/group.c b/src/kernel/group.c index bfa654cdf..482eb26f8 100755 --- a/src/kernel/group.c +++ b/src/kernel/group.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/item.c b/src/kernel/item.c index 04d106399..4f33ce9bb 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/messages.c b/src/kernel/messages.c index 344a96907..6e31810bf 100644 --- a/src/kernel/messages.c +++ b/src/kernel/messages.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/pathfinder.c b/src/kernel/pathfinder.c index ba37d651d..054fc6c27 100644 --- a/src/kernel/pathfinder.c +++ b/src/kernel/pathfinder.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/plane.c b/src/kernel/plane.c index 4fc3ff816..6d957ef57 100644 --- a/src/kernel/plane.c +++ b/src/kernel/plane.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/pool.c b/src/kernel/pool.c index 4ff2ce6f4..7236aeeed 100644 --- a/src/kernel/pool.c +++ b/src/kernel/pool.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/race.c b/src/kernel/race.c index debf368ef..af023341c 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/region.c b/src/kernel/region.c index a0f2ec99e..3fbcd2533 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/save.c b/src/kernel/save.c index 2b66c7f18..43699391e 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/ship.c b/src/kernel/ship.c index 54264e95d..6ef070849 100644 --- a/src/kernel/ship.c +++ b/src/kernel/ship.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/skills.c b/src/kernel/skills.c index 4fba7284f..7987bb75c 100644 --- a/src/kernel/skills.c +++ b/src/kernel/skills.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/spell.c b/src/kernel/spell.c index 8cc56d863..96190717f 100644 --- a/src/kernel/spell.c +++ b/src/kernel/spell.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/terrain.c b/src/kernel/terrain.c index 3f2390254..57598c43c 100644 --- a/src/kernel/terrain.c +++ b/src/kernel/terrain.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 23bcc9982..2a9a3b5da 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/laws.c b/src/laws.c index 920de6b03..519c268e4 100644 --- a/src/laws.c +++ b/src/laws.c @@ -1,6 +1,5 @@ /* -Copyright (c) 1998-2014, -Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/magic.c b/src/magic.c index 5b64b1459..ee522985c 100644 --- a/src/magic.c +++ b/src/magic.c @@ -1,6 +1,5 @@ /* -Copyright (c) 1998-2014, -Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/main.c b/src/main.c index 4216d3046..452b92353 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2018, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel @@ -193,7 +193,7 @@ static int parse_args(int argc, char **argv) else if (argi[1] == '-') { /* long format */ if (strcmp(argi + 2, "version") == 0) { printf("Eressea version %s, " - "Copyright (C) 2018 Enno Rehling et al.\n", + "Copyright (C) 2019 Enno Rehling et al.\n", eressea_version()); return 1; #ifdef USE_CURSES diff --git a/src/modules/museum.c b/src/modules/museum.c index 36aa1d63f..72e0b31b5 100644 --- a/src/modules/museum.c +++ b/src/modules/museum.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/modules/score.c b/src/modules/score.c index 0ffb73301..31a06d1cd 100644 --- a/src/modules/score.c +++ b/src/modules/score.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/monsters.c b/src/monsters.c index 535e03166..b67399a30 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -1,5 +1,5 @@ /* - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/morale.c b/src/morale.c index 7d76db6b9..5fd2c8205 100644 --- a/src/morale.c +++ b/src/morale.c @@ -1,6 +1,5 @@ /* -Copyright (c) 1998-2014, -Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/move.c b/src/move.c index baddba11e..984904608 100644 --- a/src/move.c +++ b/src/move.c @@ -1,6 +1,5 @@ /* -Copyright (c) 1998-2018, -Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/names.c b/src/names.c index bf753d8db..c1193d5f5 100644 --- a/src/names.c +++ b/src/names.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/races/dragons.c b/src/races/dragons.c index 872893b64..c5fabd09f 100644 --- a/src/races/dragons.c +++ b/src/races/dragons.c @@ -1,7 +1,5 @@ /* - * - * - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/races/zombies.c b/src/races/zombies.c index 652ccc1e2..3227f621a 100644 --- a/src/races/zombies.c +++ b/src/races/zombies.c @@ -1,5 +1,5 @@ /* - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/randenc.c b/src/randenc.c index e6ebf549b..0011e5b0e 100644 --- a/src/randenc.c +++ b/src/randenc.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/report.c b/src/report.c index 61cb915b8..06b8fa7fd 100644 --- a/src/report.c +++ b/src/report.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/reports.c b/src/reports.c index 306fe0e10..048233254 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/spells.c b/src/spells.c index 6f1c5b60e..09abcdb77 100644 --- a/src/spells.c +++ b/src/spells.c @@ -1,7 +1,7 @@ /* * * - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/spells/buildingcurse.c b/src/spells/buildingcurse.c index 61acfbcee..b25abef34 100644 --- a/src/spells/buildingcurse.c +++ b/src/spells/buildingcurse.c @@ -1,6 +1,6 @@ /* * - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/spells/regioncurse.c b/src/spells/regioncurse.c index d984715c1..35a09a515 100644 --- a/src/spells/regioncurse.c +++ b/src/spells/regioncurse.c @@ -1,6 +1,6 @@ /* * - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/spells/shipcurse.c b/src/spells/shipcurse.c index 4d62d1968..278e1ec93 100644 --- a/src/spells/shipcurse.c +++ b/src/spells/shipcurse.c @@ -1,6 +1,6 @@ /* * - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/spells/unitcurse.c b/src/spells/unitcurse.c index 1d476a7be..c3f0e05c2 100644 --- a/src/spells/unitcurse.c +++ b/src/spells/unitcurse.c @@ -1,6 +1,6 @@ /* * - * Eressea PB(E)M host Copyright (C) 1998-2015 + * Eressea PB(E)M host Copyright (C) 1998-2019 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) diff --git a/src/spy.c b/src/spy.c index 75a1e5c6a..e1e65ef95 100644 --- a/src/spy.c +++ b/src/spy.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/steal.c b/src/steal.c index 39158feba..2e9fafebb 100644 --- a/src/steal.c +++ b/src/steal.c @@ -1,6 +1,5 @@ /* -Copyright (c) 1998-2014, -Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/study.c b/src/study.c index 8d39e5d5f..116b730c2 100644 --- a/src/study.c +++ b/src/study.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/teleport.c b/src/teleport.c index 2d8fafe72..66315d52b 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/travelthru.c b/src/travelthru.c index 5a1af28eb..419c71046 100644 --- a/src/travelthru.c +++ b/src/travelthru.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/changefaction.c b/src/triggers/changefaction.c index c29304992..91703c552 100644 --- a/src/triggers/changefaction.c +++ b/src/triggers/changefaction.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/changerace.c b/src/triggers/changerace.c index 19a84eea2..0e5498663 100644 --- a/src/triggers/changerace.c +++ b/src/triggers/changerace.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/clonedied.c b/src/triggers/clonedied.c index c6593c2a4..861972c1f 100644 --- a/src/triggers/clonedied.c +++ b/src/triggers/clonedied.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/createcurse.c b/src/triggers/createcurse.c index 83f12b3be..4db37a738 100644 --- a/src/triggers/createcurse.c +++ b/src/triggers/createcurse.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/createunit.c b/src/triggers/createunit.c index ec1521bee..bdb8662e0 100644 --- a/src/triggers/createunit.c +++ b/src/triggers/createunit.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/giveitem.c b/src/triggers/giveitem.c index 3e1047f2c..6e7a7a77b 100644 --- a/src/triggers/giveitem.c +++ b/src/triggers/giveitem.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/killunit.c b/src/triggers/killunit.c index 0338da4af..0e49d90e2 100644 --- a/src/triggers/killunit.c +++ b/src/triggers/killunit.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/shock.c b/src/triggers/shock.c index 76fd6337f..a8b4774fa 100644 --- a/src/triggers/shock.c +++ b/src/triggers/shock.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/timeout.c b/src/triggers/timeout.c index 20c0b79fe..d9adda4dc 100644 --- a/src/triggers/timeout.c +++ b/src/triggers/timeout.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/triggers/triggers.c b/src/triggers/triggers.c index 13504f216..67e36381a 100644 --- a/src/triggers/triggers.c +++ b/src/triggers/triggers.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/base36.c b/src/util/base36.c index 33701f0f6..3fc0b354f 100644 --- a/src/util/base36.c +++ b/src/util/base36.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/functions.c b/src/util/functions.c index 3776820eb..f7f7544d9 100644 --- a/src/util/functions.c +++ b/src/util/functions.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/goodies.c b/src/util/goodies.c index a673e6e55..1c115a207 100644 --- a/src/util/goodies.c +++ b/src/util/goodies.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/language.c b/src/util/language.c index de31075cc..18548162f 100644 --- a/src/util/language.c +++ b/src/util/language.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/lists.c b/src/util/lists.c index 710a3c4f1..21caa7d86 100644 --- a/src/util/lists.c +++ b/src/util/lists.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/rand.c b/src/util/rand.c index 3ab4490ab..e76f30925 100644 --- a/src/util/rand.c +++ b/src/util/rand.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/resolve.c b/src/util/resolve.c index 5f1787056..589707f46 100644 --- a/src/util/resolve.c +++ b/src/util/resolve.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/strings.c b/src/util/strings.c index f26f460e2..7a2739650 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/util/umlaut.c b/src/util/umlaut.c index c070acb55..5f135df69 100644 --- a/src/util/umlaut.c +++ b/src/util/umlaut.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel diff --git a/src/volcano.c b/src/volcano.c index 91132db14..1e117b567 100644 --- a/src/volcano.c +++ b/src/volcano.c @@ -1,5 +1,5 @@ /* -Copyright (c) 1998-2015, Enno Rehling +Copyright (c) 1998-2019, Enno Rehling Katja Zedel From a33ac3b402fa11e4d877134422cd12386d943418 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 27 Jul 2019 09:28:50 +0200 Subject: [PATCH 4/5] Increase MAX_WORKERS for Blumenkinder. --- src/economy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/economy.c b/src/economy.c index b7ece1d45..72e623542 100644 --- a/src/economy.c +++ b/src/economy.c @@ -2709,10 +2709,11 @@ void loot_cmd(unit * u, struct order *ord, econ_request ** lootorders) return; } -#define MAX_WORKERS 512 +#define MAX_WORKERS 1024 +static struct econ_request workers[MAX_WORKERS]; + void auto_work(region * r) { - econ_request workers[MAX_WORKERS]; econ_request *nextworker = workers; unit *u; @@ -2781,7 +2782,6 @@ static bool rule_autowork(void) { void produce(struct region *r) { - econ_request workers[MAX_WORKERS]; econ_request *taxorders, *lootorders, *sellorders, *stealorders, *buyorders; unit *u; bool limited = true; From c3e86ff6dadc05bed0a465fb0fc93044e8270184 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 27 Jul 2019 16:50:45 +0200 Subject: [PATCH 5/5] Make the worst-case number of Golems look better. --- src/spells.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/spells.c b/src/spells.c index 09abcdb77..a16ec8573 100644 --- a/src/spells.c +++ b/src/spells.c @@ -1484,8 +1484,7 @@ static int sp_create_irongolem(castorder * co) region *r = co_get_region(co); unit *caster = co_get_caster(co); int cast_level = co->level; - double force = co->force; - int number = lovar(force * 8 * RESOURCE_QUANTITY); + int number = (int)((co->force * 4 + lovar(co->force * 4)) * RESOURCE_QUANTITY); static int cache; static const race * golem_rc; @@ -1554,7 +1553,7 @@ static int sp_create_stonegolem(castorder * co) region *r = co_get_region(co); unit *caster = co_get_caster(co); int cast_level = co->level; - int number = lovar(co->force * 5 * RESOURCE_QUANTITY); + int number = (int)((co->force * 2 + lovar(co->force * 3)) * RESOURCE_QUANTITY); static int cache; static const race * golem_rc;