Merge pull request #786 from ennorehling/master

bugfixes turn 1080
This commit is contained in:
Enno Rehling 2018-06-10 10:44:15 +02:00 committed by GitHub
commit eb4a13cd76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 5 deletions

View File

@ -1907,7 +1907,7 @@ msgid "castle"
msgstr "Burg" msgstr "Burg"
msgid "nr_borderlist_infix" msgid "nr_borderlist_infix"
msgstr ", im" msgstr ", im "
msgctxt "race" msgctxt "race"
msgid "shadowbat_p" msgid "shadowbat_p"
@ -3707,7 +3707,7 @@ msgid "analyse_object"
msgstr "Lied des Ortes analysieren" msgstr "Lied des Ortes analysieren"
msgid "nr_borderlist_lastfix" msgid "nr_borderlist_lastfix"
msgstr "und im" msgstr "und im "
msgctxt "race" msgctxt "race"
msgid "shadowknight_d" msgid "shadowknight_d"
@ -5573,7 +5573,7 @@ msgid "swamp_trail"
msgstr "der Sumpf von %s" msgstr "der Sumpf von %s"
msgid "nr_nb_final" msgid "nr_nb_final"
msgstr "und im" msgstr "und im "
msgid "aoc" msgid "aoc"
msgstr "Katzenamulett" msgstr "Katzenamulett"

View File

@ -491,8 +491,29 @@ function test_dwarf_mining()
local f = faction.create('dwarf') local f = faction.create('dwarf')
local r = region.create(0, 0, 'plain') local r = region.create(0, 0, 'plain')
local u = unit.create(f, r) local u = unit.create(f, r)
u.name = 'Xolgrim'
u:set_skill('mining', 2) u:set_skill('mining', 2)
assert_equal(2, u:get_skill('mining')) assert_equal(2, u:get_skill('mining'))
assert_equal(4, u:eff_skill('mining')) assert_equal(4, u:eff_skill('mining'))
end end
function test_buy_sell()
local f = faction.create('human')
local r = region.create(0, 0, 'plain')
local u = unit.create(f, r)
local lux = r.luxury
local b = building.create(r, 'castle')
b.size = 10
u:set_skill('trade', 1)
item = 'silk'
name = 'Seide'
if lux == 'silk' then
item = 'balm'
name = 'Balsam'
end
u:add_item(item, 5)
u:add_order('VERKAUFE 1 ' .. name)
assert_equal(0, u:get_item('money'))
process_orders()
assert_equal(4, u:get_item(item))
assert_not_equal(0, u:get_item('money'))
end

View File

@ -818,7 +818,9 @@ static void start_resources(parseinfo *pi, const XML_Char *el, const XML_Char **
handle_requirement(pi, el, attr); handle_requirement(pi, el, attr);
} }
else if (xml_strcmp(el, "luxury") == 0) { else if (xml_strcmp(el, "luxury") == 0) {
rtype->ltype = new_luxurytype(itype, 0); int price = atoi(attr_get(attr, "price"));
assert(price > 0);
rtype->ltype = new_luxurytype(itype, price);
} }
else if (xml_strcmp(el, "potion") == 0) { else if (xml_strcmp(el, "potion") == 0) {
int i, level = 0; int i, level = 0;