From 2d32dc27210d16102f9200de115f2c3f79a5cb22 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 17:45:52 +0300 Subject: Use BeingTypeId in Being for subtypeid. --- src/resources/iteminfo.cpp | 5 +++-- src/resources/iteminfo.h | 5 ++++- src/resources/questeffect.h | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/resources') diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index c68762728..0cdbed04d 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -87,7 +87,7 @@ ItemInfo::~ItemInfo() } const std::string &ItemInfo::getSprite(const Gender::Type gender, - const int race) const + const BeingTypeId race) const { if (mView) { @@ -98,7 +98,8 @@ const std::string &ItemInfo::getSprite(const Gender::Type gender, { static const std::string empty; std::map::const_iterator i = - mAnimationFiles.find(static_cast(gender) + race * 4); + mAnimationFiles.find(static_cast(gender) + + toInt(race, int) * 4); if (i != mAnimationFiles.end()) return i->second; diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 55e35ea22..3331d7882 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -25,6 +25,8 @@ #include "enums/being/gender.h" +#include "enums/simpletypes/beingtypeid.h" + #include "resources/cursor.h" #include "resources/itemtype.h" #include "resources/soundinfo.h" @@ -125,7 +127,8 @@ class ItemInfo final const Gender::Type gender, const int race); const std::string &getSprite(const Gender::Type gender, - const int race) const A_WARN_UNUSED; + const BeingTypeId race) + const A_WARN_UNUSED; void setAttackAction(const std::string &attackAction); diff --git a/src/resources/questeffect.h b/src/resources/questeffect.h index c152ce0e8..c4cb13e3e 100644 --- a/src/resources/questeffect.h +++ b/src/resources/questeffect.h @@ -21,6 +21,8 @@ #ifndef RESOURCES_QUESTEFFECT_H #define RESOURCES_QUESTEFFECT_H +#include "enums/simpletypes/beingtypeid.h" + #include #include @@ -31,7 +33,7 @@ struct QuestEffect final QuestEffect() : map(), var(0), - id(0), + id(BeingTypeId_zero), effectId(0), values() { @@ -39,7 +41,7 @@ struct QuestEffect final std::string map; int var; - int id; + BeingTypeId id; int effectId; std::set values; }; -- cgit v1.2.3-70-g09d2