Merge branch 'master' of github.com:eressea/server

Conflicts:
	src/kernel/item.test.c
This commit is contained in:
Enno Rehling 2015-01-30 20:44:42 +01:00
commit a97a7bbf1d
7 changed files with 87 additions and 15 deletions

View File

@ -58,6 +58,7 @@
<order name="tax" disable="yes"/>
<order name="entertain" disable="yes"/>
<order name="sell" disable="yes"/>
<order name="origin" disable="yes"/>
<skill name="armorer" enable="true"/>
<skill name="bow" enable="true"/>

View File

@ -1,6 +1,10 @@
<?xml version="1.0"?>
<resources>
<resource name="money">
<item weight="0"/>
</resource>
<resource name="ao_healing" appearance="amulet">
<item weight="0" score="6000"/>
</resource>

View File

@ -5858,8 +5858,8 @@
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Laen kann nur in einem Bergwerk abgebaut werden."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - Laen can be excavated only in a mine."</text>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Dieses Metall kann nur in einem Bergwerk abgebaut werden."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - This metal can be excavated only in a mine."</text>
</message>
<message name="error103" section="errors">
<type>

View File

@ -712,6 +712,42 @@ function test_golem_use_four_iron()
assert_equal(4, u1:get_item("towershield"))
end
function skip_test_silver_weight_stops_movement()
local r1 = region.create(1, 1, "plain")
local r2 = region.create(2, 1, "plain")
region.create(3, 1, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f1, r1, 1)
u1:clear_orders()
u1:add_order("NACH OST")
u1:add_item("money", 540)
assert_equal(1540, u1.weight)
process_orders()
assert_equal(r2, u1.region)
u1:add_item("money", 1)
process_orders()
assert_equal(r2, u1.region)
end
function skip_test_silver_weight_stops_ship()
local r1 = region.create(1, 1, "ocean")
local r2 = region.create(2, 1, "ocean")
region.create(3, 1, "ocean")
local f1 = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f1, r1, 1)
u1:set_skill("sailing", 3)
local s1 = ship.create(r1, "canoe")
u1.ship = s1
u1:clear_orders()
u1:add_order("NACH OST")
u1:add_item("money", 2000)
process_orders()
assert_equal(r2, u1.region)
u1:add_item("money", 1)
process_orders()
assert_equal(r2, u1.region)
end
function test_building_owner_can_enter_ship()
local r1 = region.create(1, 2, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")
@ -734,3 +770,12 @@ function test_building_owner_can_enter_ship()
assert_equal(s1, u1.ship)
assert_equal(null, u1.building, "owner of the building can not go into a ship")
end
function test_weightless_silver()
local r1 = region.create(1, 2, "plain")
local f1 = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f1, r1, 1)
assert_equal(1000, u1.weight)
u1:add_item("money", 540)
assert_equal(1000, u1.weight)
end

View File

@ -143,6 +143,27 @@ static void test_fix_demand(CuTest *tc) {
test_cleanup();
}
static void test_core_resources(CuTest *tc) {
resource_type * rtype;
test_cleanup();
init_resources();
CuAssertPtrNotNull(tc, rtype = rt_find("money"));
CuAssertPtrNotNull(tc, rtype->itype);
CuAssertPtrNotNull(tc, rtype->uchange);
CuAssertPtrNotNull(tc, rtype->itype->give);
CuAssertPtrNotNull(tc, rtype = rt_find("peasant"));
CuAssertPtrEquals(tc, 0, rtype->itype);
CuAssertPtrNotNull(tc, rtype = rt_find("person"));
CuAssertPtrEquals(tc, 0, rtype->itype);
CuAssertPtrNotNull(tc, rtype = rt_find("permaura"));
CuAssertPtrEquals(tc, 0, rtype->itype);
CuAssertPtrNotNull(tc, rtype = rt_find("hp"));
CuAssertPtrEquals(tc, 0, rtype->itype);
CuAssertPtrNotNull(tc, rtype = rt_find("aura"));
CuAssertPtrEquals(tc, 0, rtype->itype);
test_cleanup();
}
CuSuite *get_item_suite(void)
{
CuSuite *suite = CuSuiteNew();
@ -153,5 +174,6 @@ CuSuite *get_item_suite(void)
SUITE_ADD_TEST(suite, test_finditemtype);
SUITE_ADD_TEST(suite, test_findresourcetype);
SUITE_ADD_TEST(suite, test_fix_demand);
SUITE_ADD_TEST(suite, test_core_resources);
return suite;
}

View File

@ -4347,17 +4347,17 @@ void init_processor(void)
add_proc_order(p, K_GROUP, group_cmd, 0, NULL);
p += 10;
add_proc_order(p, K_QUIT, quit_cmd, 0, NULL);
add_proc_order(p, K_URSPRUNG, origin_cmd, 0, NULL);
add_proc_order(p, K_ALLY, ally_cmd, 0, NULL);
add_proc_order(p, K_PREFIX, prefix_cmd, 0, NULL);
add_proc_order(p, K_SETSTEALTH, setstealth_cmd, 0, NULL);
add_proc_order(p, K_STATUS, status_cmd, 0, NULL);
add_proc_order(p, K_COMBATSPELL, combatspell_cmd, 0, NULL);
add_proc_order(p, K_DISPLAY, display_cmd, 0, NULL);
add_proc_order(p, K_NAME, name_cmd, 0, NULL);
add_proc_order(p, K_GUARD, guard_off_cmd, 0, NULL);
add_proc_order(p, K_RESHOW, reshow_cmd, 0, NULL);
add_proc_order(p, K_QUIT, &quit_cmd, 0, NULL);
add_proc_order(p, K_URSPRUNG, &origin_cmd, 0, NULL);
add_proc_order(p, K_ALLY, &ally_cmd, 0, NULL);
add_proc_order(p, K_PREFIX, &prefix_cmd, 0, NULL);
add_proc_order(p, K_SETSTEALTH, &setstealth_cmd, 0, NULL);
add_proc_order(p, K_STATUS, &status_cmd, 0, NULL);
add_proc_order(p, K_COMBATSPELL, &combatspell_cmd, 0, NULL);
add_proc_order(p, K_DISPLAY, &display_cmd, 0, NULL);
add_proc_order(p, K_NAME, &name_cmd, 0, NULL);
add_proc_order(p, K_GUARD, &guard_off_cmd, 0, NULL);
add_proc_order(p, K_RESHOW, &reshow_cmd, 0, NULL);
if (get_param_int(global.parameters, "rules.alliances", 0) == 1) {
p += 10;

View File

@ -1044,11 +1044,11 @@ static int sp_mallorn(castorder * co)
unit *mage = co->magician.u;
if (!fval(r->terrain, LAND_REGION)) {
cmistake(mage, co->order, 290, MSG_MAGIC);
cmistake(mage, co->order, 186, MSG_MAGIC);
return 0;
}
if (fval(r, RF_MALLORN)) {
cmistake(mage, co->order, 291, MSG_MAGIC);
cmistake(mage, co->order, 191, MSG_MAGIC);
return 0;
}