diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 59cafff0c..584d2affc 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -2647,7 +2647,7 @@ expandentertainment(region * r) change_money(u, u->n); rsetmoney(r, rmoney(r) - u->n); m -= u->n; - entertaining -= u->n; + entertaining -= o->qty; /* Nur soviel PRODUCEEXP wie auch tatsächlich gemacht wurde */ produceexp(u, SK_ENTERTAINMENT, min(u->n, u->number)); diff --git a/src/eressea/lua/unit.cpp b/src/eressea/lua/unit.cpp index e9cb941ee..e47b94085 100644 --- a/src/eressea/lua/unit.cpp +++ b/src/eressea/lua/unit.cpp @@ -318,27 +318,7 @@ unit_setmagic(unit& u, const char * type) static void unit_addorder(unit& u, const char * str) { - char buf[1024]; - char * s = buf; - boolean quote = false; - order * ord; - - while (*str) { - switch (*str) { - case '"': - quote=!quote; - break; - case ' ': - if (quote) *s++ = SPACE_REPLACEMENT; - else *s++ = ' '; - break; - default: - *s++ = *str; - } - ++str; - } - *s=0; - ord = parse_order(buf, u.faction->locale); + order * ord = parse_order(str, u.faction->locale); addlist(&u.orders, ord); u.faction->lastorders = turn; } diff --git a/src/scripts/samples.lua b/src/scripts/samples.lua index 839bb5814..72197f4bd 100644 --- a/src/scripts/samples.lua +++ b/src/scripts/samples.lua @@ -155,7 +155,28 @@ function test_monsters() process_orders() end -test_monsters() +function test_parser() + -- this script tests the changes to quotes + + plain = terraform(0, 0, "plain") + skill = 5 + + f = add_faction("enno@eressea.de", "human", "de") + f.age = 20 + u = add_unit(f, plain) + u.number = 10 + u:clear_orders() + u:add_order("Nummer Partei test") + u:add_order("BENENNE PARTEI \"Diese Partei heisst \\\"Enno's Schergen\\\".\"") + u:add_order("BENENNE EINHEIT \"Mein Name ist \\\"Enno\\\".\"") + + process_orders() + write_reports() + write_game("parser") +end + +test_parser() +-- test_monsters() -- test_combat() -- test_rewards() -- test_give()