diff --git a/scripts/tests/e3/items.lua b/scripts/tests/e3/items.lua index 9c6035bf7..b2100f5ed 100644 --- a/scripts/tests/e3/items.lua +++ b/scripts/tests/e3/items.lua @@ -26,7 +26,7 @@ function test_goblins() for k, v in ipairs(restricted) do u1:add_item(v, 1) u2:add_item(v, 1) - u2:add_item(v, 1) + u3:add_item(v, 1) end u1:add_order("ATTACKIERE " .. itoa36(u2.id)) diff --git a/src/battle.c b/src/battle.c index 9e2958242..fa5725c50 100644 --- a/src/battle.c +++ b/src/battle.c @@ -580,7 +580,12 @@ static bool i_canuse(const unit * u, const item_type * itype) if (itype->canuse) { 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; }