forked from github/server
Fix BUG 0001976
http://bugs.eressea.de/view.php?id=1976 Check that only buling owner set k_pay disable If other unit inside the building set k_pay disable it have now no effect, before only fraction was check
This commit is contained in:
parent
6e825d5677
commit
b70fc76921
|
@ -335,3 +335,25 @@ function test_stonegolems()
|
||||||
-- end test Stone Golems four stones
|
-- end test Stone Golems four stones
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_only_building_ownwer_can_set_not_paid()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
local f = faction.create("noreply@eressea.de", "human", "de")
|
||||||
|
local u1 = unit.create(f, r, 1)
|
||||||
|
local u2 = unit.create(f, r, 1)
|
||||||
|
local mine = building.create(r, "mine")
|
||||||
|
mine.size = 2
|
||||||
|
u1:add_item("money", 500)
|
||||||
|
u1.building = mine
|
||||||
|
u2.building = mine
|
||||||
|
u1:clear_orders()
|
||||||
|
u2:clear_orders()
|
||||||
|
u2:add_order("Bezahle nicht")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(0, u1:get_item("money"))
|
||||||
|
u2:clear_orders()
|
||||||
|
u1:add_item("money", 500)
|
||||||
|
u1:add_order("Bezahle nicht")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(500, u1:get_item("money"))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
|
@ -4027,7 +4027,7 @@ int pay_cmd(unit * u, struct order *ord)
|
||||||
p = getparam(u->faction->locale);
|
p = getparam(u->faction->locale);
|
||||||
if (p == P_NOT) {
|
if (p == P_NOT) {
|
||||||
unit *owner = building_owner(u->building);
|
unit *owner = building_owner(u->building);
|
||||||
if (owner->faction != u->faction) {
|
if (owner->no != u->no) {
|
||||||
cmistake(u, ord, 1222, MSG_EVENT);
|
cmistake(u, ord, 1222, MSG_EVENT);
|
||||||
} else {
|
} else {
|
||||||
u->building->flags |= BLD_DONTPAY;
|
u->building->flags |= BLD_DONTPAY;
|
||||||
|
|
Loading…
Reference in New Issue