diff options
Diffstat (limited to 'engines/xeen/item.cpp')
-rw-r--r-- | engines/xeen/item.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/xeen/item.cpp b/engines/xeen/item.cpp index cd3ba80b4e..66607039a3 100644 --- a/engines/xeen/item.cpp +++ b/engines/xeen/item.cpp @@ -44,8 +44,13 @@ void XeenItem::synchronize(Common::Serializer &s) { } ElementalCategory XeenItem::getElementalCategory() const { + assert(_material < 36); + return getElementalCategory(_material); +} + +ElementalCategory XeenItem::getElementalCategory(int material) { int idx; - for (idx = 0; Res.ELEMENTAL_CATEGORIES[idx] < _material; ++idx) + for (idx = 0; Res.ELEMENTAL_CATEGORIES[idx] < material; ++idx) ; return (ElementalCategory)idx; |