forked from eressea/server
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG owner of a building can't enter ship
If owner of a building want to enter a ship or other building, he must first leave the bulding. Commands are "leave" and "enter <ship/tower> <ID>". For buildings was that OK but not for ships. The building owner was inside the region after that commans and not in the ship.
- Loading branch information
1 parent
6639fbb
commit 918ab39
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -710,3 +710,25 @@ function test_golem_use_four_iron() | |
assert_equal(4, u1:get_item("towershield")) | ||
end | ||
|
||
function test_building_owner_can_enter_ship() | ||
local r1 = region.create(1, 2, "plain") | ||
local f1 = faction.create("noreply@tteessttiinngg.de", "human", "de") | ||
local b1 = building.create(r1, "castle") | ||
b1.size = 10 | ||
local s1 = ship.create(r1, "cutter") | ||
|
||
local u1 = unit.create(f1, r1, 10) | ||
u1.building = b1 | ||
u1:add_item("money", u1.number * 100) | ||
u1:clear_orders() | ||
u1:add_order("VERLASSEN") | ||
u1:add_order("BETRETE SCHIFF " .. itoa36(s1.id)) | ||
|
||
local u2 = unit.create(f1, r1, 10) | ||
u2.ship = s1 | ||
u2:add_item("money", u1.number * 100) | ||
u2:clear_orders() | ||
process_orders() | ||
assert_equal(s1.id, u1.ship.id) | ||
assert_not_equal(b1.id, u1.ship.id, "BUG owner of the building can not go into a ship") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
TomBraun
Owner
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This assert seems strange: the id of the building must not be equal to the id of the ship that the unit is in? ships are not buildings, and comparing their ids makes no sense at all.
I think you mean to say something else (that the unit is not in a building?)