fix region owner when a building transfers

This commit is contained in:
Enno Rehling 2012-05-26 10:43:37 -07:00
parent 1ba2ed200b
commit 8ca04a02aa
2 changed files with 3 additions and 3 deletions

View File

@ -143,9 +143,9 @@ end
function test_morale_old()
local r = region.create(0, 0, "plain")
assert_equal(1, r.morale)
local f1 = faction.create("noreply@eressea.de", "human", "de")
local f1 = faction.create("first@eressea.de", "human", "de")
local u1 = unit.create(f1, r, 1)
local f2 = faction.create("noreply@eressea.de", "human", "de")
local f2 = faction.create("second@eressea.de", "human", "de")
local u2 = unit.create(f2, r, 1)
local b = building.create(r, "castle")

View File

@ -70,7 +70,7 @@ static void equip_newunits(const struct equipment *eq, struct unit *u)
building *b = new_building(btype, r, u->faction->locale);
b->size = 10;
u_set_building(u, b);
building_set_owner(b, u);
building_set_owner(u);
}
}
break;