From ecc3b1b4417eb70cb3c631bc36910f52e6bbbcd6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 2 Nov 2014 11:10:26 +0100 Subject: [PATCH 1/3] Dragons re using the new LOOT command. Fixing the income message (missing ")"). --- res/core/messages.xml | 2 +- src/economy.c | 2 +- src/monsters.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/res/core/messages.xml b/res/core/messages.xml index 932276078..dfbeecd07 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -2754,7 +2754,7 @@ - "$unit($unit) verdient$if($eq($mode,4)," am Handel","") in $region($region) $int($amount)$if($eq($wanted,$amount),""," statt $int($wanted)") Silber$if($eq($mode,1)," durch Unterhaltung",$if($eq($mode,2)," durch Steuern",$if($eq($mode,3)," durch Handel",$if($eq($mode,5)," durch Diebstahl",$if($eq($mode,6)," durch Zauberei",$if($eq($mode,7)," durch Pluendern","")))))." + "$unit($unit) verdient$if($eq($mode,4)," am Handel","") in $region($region) $int($amount)$if($eq($wanted,$amount),""," statt $int($wanted)") Silber$if($eq($mode,1)," durch Unterhaltung",$if($eq($mode,2)," durch Steuern",$if($eq($mode,3)," durch Handel",$if($eq($mode,5)," durch Diebstahl",$if($eq($mode,6)," durch Zauberei",$if($eq($mode,7)," durch Plündern",""))))))." "$unit($unit) earns $int($amount)$if($eq($wanted,$amount),""," of $int($wanted)") in $region($region)." "$unit($unit) earns $int($amount)$if($eq($wanted,$amount),""," of $int($wanted)") in $region($region)." diff --git a/src/economy.c b/src/economy.c index ab061a5f4..a9c8b9894 100644 --- a/src/economy.c +++ b/src/economy.c @@ -3444,7 +3444,6 @@ void produce(struct region *r) request workers[MAX_WORKERS]; request *taxorders, *lootorders, *sellorders, *stealorders, *buyorders; unit *u; - int todo; static int rule_autowork = -1; bool limited = true; request *nextworker = workers; @@ -3484,6 +3483,7 @@ void produce(struct region *r) for (u = r->units; u; u = u->next) { order *ord; bool trader = false; + keyword_t todo; if (u_race(u) == get_race(RC_SPELL) || fval(u, UFL_LONGACTION)) continue; diff --git a/src/monsters.c b/src/monsters.c index 4136d04a6..aa9fd20f4 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -26,6 +26,7 @@ #include "give.h" #include "monster.h" #include "laws.h" +#include "keyword.h" /* triggers includes */ #include @@ -173,7 +174,7 @@ static order *get_money_for_dragon(region * r, unit * u, int wanted) /* 5% chance, dass der drache aus einer laune raus attackiert */ if (attack_chance <= 0.0 || chance(1.0 - u_race(u)->aggression)) { /* Drachen haben in E3 und E4 keine Einnahmen. Neuer Befehl Pluendern erstmal nur fuer Monster?*/ - return create_order(K_TAX, default_locale, NULL); + return create_order(K_LOOT, default_locale, NULL); } } @@ -866,6 +867,7 @@ void plan_monsters(faction * f) } if (long_order) { addlist(&u->orders, long_order); +// u->thisorder = long_order; } } } From 59075b7194c9af49ac7ee0ea8f037156408446e4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 2 Nov 2014 12:45:20 +0100 Subject: [PATCH 2/3] fixing the gcc build (switch warning) --- src/economy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/economy.c b/src/economy.c index a9c8b9894..d2da71570 100644 --- a/src/economy.c +++ b/src/economy.c @@ -3531,7 +3531,6 @@ void produce(struct region *r) continue; switch (todo) { - case K_ENTERTAIN: entertain_cmd(u, u->thisorder); break; @@ -3571,6 +3570,8 @@ void produce(struct region *r) case K_RESEARCH: research_cmd(u, u->thisorder); break; + default: + assert(!"should not happen"); } } From 0b96cc7d1315ffc44169bd4e9e5e25c40177df8b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 2 Nov 2014 12:54:49 +0100 Subject: [PATCH 3/3] fix previous commit --- src/economy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/economy.c b/src/economy.c index d2da71570..240b5712a 100644 --- a/src/economy.c +++ b/src/economy.c @@ -3571,7 +3571,8 @@ void produce(struct region *r) research_cmd(u, u->thisorder); break; default: - assert(!"should not happen"); + /* not handled here */ + break; } }