diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-29 17:45:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-29 17:45:52 +0300 |
commit | 2d32dc27210d16102f9200de115f2c3f79a5cb22 (patch) | |
tree | 5aa84ebe6c5c1d708b14bee2bf0ce95df714fc1d /src/actormanager.cpp | |
parent | 7bdb50605562e47f1d6ae134881c09bd42293be5 (diff) | |
download | ManaVerse-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.gz ManaVerse-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.bz2 ManaVerse-2d32dc27210d16102f9200de115f2c3f79a5cb22.tar.xz ManaVerse-2d32dc27210d16102f9200de115f2c3f79a5cb22.zip |
Use BeingTypeId in Being for subtypeid.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r-- | src/actormanager.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index 4544e445f..8c7d48752 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -240,7 +240,7 @@ void ActorManager::setPlayer(LocalPlayer *const player) Being *ActorManager::createBeing(const BeingId id, const ActorType::Type type, - const uint16_t subtype) + const BeingTypeId subtype) { Being *const being = new Being(id, type, subtype, mMap); @@ -1380,7 +1380,7 @@ void ActorManager::printBeingsToChat(const ActorSprites &beings, debugChatTab->chatLog(strprintf("%s (%d,%d) %d", being->getName().c_str(), being->getTileX(), being->getTileY(), - being->getSubType()), ChatMsgType::BY_SERVER); + toInt(being->getSubType(), int)), ChatMsgType::BY_SERVER); } debugChatTab->chatLog("---------------------------------------", ChatMsgType::BY_SERVER); @@ -1405,7 +1405,7 @@ void ActorManager::printBeingsToChat(const std::vector<Being*> &beings, debugChatTab->chatLog(strprintf("%s (%d,%d) %d", being->getName().c_str(), being->getTileX(), being->getTileY(), - being->getSubType()), ChatMsgType::BY_SERVER); + toInt(being->getSubType(), int)), ChatMsgType::BY_SERVER); } debugChatTab->chatLog("---------------------------------------", ChatMsgType::BY_SERVER); @@ -1775,18 +1775,19 @@ bool ActorManager::checkForPickup(const FloorItem *const item) const return false; } -void ActorManager::updateEffects(const std::map<int, int> &addEffects, - const std::set<int> &removeEffects) const +void ActorManager::updateEffects(const std::map<BeingTypeId, int> &addEffects, + const std::set<BeingTypeId> &removeEffects) + const { for_actorsm { if (!*it || (*it)->getType() != ActorType::Npc) continue; Being *const being = static_cast<Being*>(*it); - const int type = being->getSubType(); + const BeingTypeId type = being->getSubType(); if (removeEffects.find(type) != removeEffects.end()) being->removeSpecialEffect(); - const std::map<int, int>::const_iterator idAdd = addEffects.find(type); + const std::map<BeingTypeId, int>::const_iterator idAdd = addEffects.find(type); if (idAdd != addEffects.end()) being->addSpecialEffect((*idAdd).second); } |