generate error, not crash.

todo: fix items
This commit is contained in:
Enno Rehling 2017-02-28 10:58:09 +01:00
parent 5a01eae522
commit c276b5a43c
2 changed files with 7 additions and 2 deletions

View File

@ -26,7 +26,7 @@ function test_goblins()
for k, v in ipairs(restricted) do for k, v in ipairs(restricted) do
u1:add_item(v, 1) u1:add_item(v, 1)
u2:add_item(v, 1) u2:add_item(v, 1)
u2:add_item(v, 1) u3:add_item(v, 1)
end end
u1:add_order("ATTACKIERE " .. itoa36(u2.id)) u1:add_order("ATTACKIERE " .. itoa36(u2.id))

View File

@ -580,7 +580,12 @@ static bool i_canuse(const unit * u, const item_type * itype)
if (itype->canuse) { if (itype->canuse) {
result = itype->canuse(u, itype); result = itype->canuse(u, itype);
} }
assert(result==rc_can_use(u_race(u), itype)); if (result!=rc_can_use(u_race(u), itype)) {
log_error("conversion error: %s should be %s to use %s",
u->_race->_name,
result ? "allowed" : "forbidden",
itype->rtype->_name);
}
return result; return result;
} }