summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/actionmanager.cpp20
-rw-r--r--src/actormanager.cpp142
-rw-r--r--src/actormanager.h27
-rw-r--r--src/being/actorsprite.cpp2
-rw-r--r--src/being/actorsprite.h17
-rw-r--r--src/being/actortype.h40
-rw-r--r--src/being/being.cpp98
-rw-r--r--src/being/being.h10
-rw-r--r--src/being/localplayer.cpp20
-rw-r--r--src/being/playerrelations.cpp10
-rw-r--r--src/commands.cpp14
-rw-r--r--src/flooritem.h4
-rw-r--r--src/gui/popups/beingpopup.cpp2
-rw-r--r--src/gui/popups/popupmenu.cpp84
-rw-r--r--src/gui/viewport.cpp34
-rw-r--r--src/gui/widgets/avatarlistbox.cpp6
-rw-r--r--src/gui/windows/botcheckerwindow.cpp4
-rw-r--r--src/gui/windows/charcreatedialog.cpp2
-rw-r--r--src/gui/windows/chatwindow.cpp8
-rw-r--r--src/gui/windows/killstats.cpp2
-rw-r--r--src/gui/windows/minimap.cpp18
-rw-r--r--src/gui/windows/npcdialog.cpp2
-rw-r--r--src/gui/windows/shopwindow.cpp4
-rw-r--r--src/gui/windows/socialwindow.cpp6
-rw-r--r--src/gui/windows/whoisonline.cpp6
-rw-r--r--src/guildmanager.cpp2
-rw-r--r--src/net/ea/beinghandler.cpp50
-rw-r--r--src/net/ea/chathandler.cpp4
-rw-r--r--src/net/ea/guildhandler.cpp6
-rw-r--r--src/net/ea/partyhandler.cpp4
-rw-r--r--src/net/eathena/beinghandler.cpp22
-rw-r--r--src/net/eathena/guildhandler.cpp2
-rw-r--r--src/net/eathena/partyhandler.cpp2
-rw-r--r--src/net/tmwa/beinghandler.cpp8
-rw-r--r--src/net/tmwa/guildhandler.cpp2
-rw-r--r--src/net/tmwa/partyhandler.cpp2
-rw-r--r--src/spellmanager.cpp2
39 files changed, 366 insertions, 324 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c4d54628f..bca0cc342 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -602,6 +602,7 @@ SET(SRCS
being/actor.h
being/actorsprite.cpp
being/actorsprite.h
+ being/actortype.h
being/attributes.h
listeners/actorspritelistener.h
listeners/arrowslistener.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 5066444e6..52741624c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -691,6 +691,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
being/actor.h \
being/actorsprite.cpp \
being/actorsprite.h \
+ being/actortype.h \
being/attributes.h \
listeners/actorspritelistener.h \
listeners/arrowslistener.cpp \
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index ffb26799e..bfdf15b86 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -397,10 +397,10 @@ impHandler0(heal)
if (inputManager.isActionActive(Input::KEY_STOP_ATTACK))
{
Being *target = player_node->getTarget();
- if (!target || target->getType() != ActorSprite::PLAYER)
+ if (!target || target->getType() != ActorType::PLAYER)
{
target = actorManager->findNearestLivingBeing(
- player_node, 10, ActorSprite::PLAYER);
+ player_node, 10, ActorType::PLAYER);
if (target)
player_node->setTarget(target);
}
@@ -1004,7 +1004,7 @@ impHandler0(talk)
if (!target && actorManager)
{
target = actorManager->findNearestLivingBeing(
- player_node, 1, ActorSprite::NPC);
+ player_node, 1, ActorType::NPC);
// ignore closest target if distance in each direction more than 1
if (target)
{
@@ -1019,7 +1019,7 @@ impHandler0(talk)
{
if (target->canTalk())
target->talkTo();
- else if (target->getType() == Being::PLAYER)
+ else if (target->getType() == ActorType::PLAYER)
new BuySellDialog(target->getName());
}
return true;
@@ -1075,7 +1075,7 @@ impHandler0(targetAttack)
{
// Only auto target Monsters
target = actorManager->findNearestLivingBeing(
- player_node, 90, ActorSprite::MONSTER);
+ player_node, 90, ActorType::MONSTER);
}
else
{
@@ -1088,7 +1088,7 @@ impHandler0(targetAttack)
return false;
}
-static bool setTarget(const ActorSprite::Type type)
+static bool setTarget(const ActorType::Type type)
{
if (actorManager && player_node)
{
@@ -1105,17 +1105,17 @@ static bool setTarget(const ActorSprite::Type type)
impHandler0(targetPlayer)
{
- return setTarget(ActorSprite::PLAYER);
+ return setTarget(ActorType::PLAYER);
}
impHandler0(targetMonster)
{
- return setTarget(ActorSprite::MONSTER);
+ return setTarget(ActorType::MONSTER);
}
impHandler0(targetNPC)
{
- return setTarget(ActorSprite::NPC);
+ return setTarget(ActorType::NPC);
}
impHandler0(safeVideoMode)
@@ -1216,7 +1216,7 @@ impHandler0(prevCommandsTab)
impHandler0(openTrade)
{
const Being *const being = player_node->getTarget();
- if (being && being->getType() == ActorSprite::PLAYER)
+ if (being && being->getType() == ActorType::PLAYER)
{
Net::getTradeHandler()->request(being);
tradePartnerName = being->getName();
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 855ff3265..f8d4e137e 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -62,25 +62,25 @@ class FindBeingFunctor final
public:
bool operator() (const ActorSprite *const actor) const
{
- if (!actor || actor->getType() == ActorSprite::FLOOR_ITEM
- || actor->getType() == ActorSprite::PORTAL)
+ if (!actor || actor->getType() == ActorType::FLOOR_ITEM
+ || actor->getType() == ActorType::PORTAL)
{
return false;
}
const Being *const b = static_cast<const Being* const>(actor);
const unsigned other_y = y + ((b->getType()
- == ActorSprite::NPC) ? 1 : 0);
+ == ActorType::NPC) ? 1 : 0);
const Vector &pos = b->getPosition();
return (static_cast<unsigned>(pos.x) / mapTileSize == x &&
(static_cast<unsigned>(pos.y) / mapTileSize == y
|| static_cast<unsigned>(pos.y) / mapTileSize == other_y) &&
- b->isAlive() && (type == ActorSprite::UNKNOWN
+ b->isAlive() && (type == ActorType::UNKNOWN
|| b->getType() == type));
}
uint16_t x, y;
- ActorSprite::Type type;
+ ActorType::Type type;
} beingActorFinder;
class FindBeingEqualFunctor final
@@ -226,7 +226,7 @@ void ActorManager::setPlayer(LocalPlayer *const player)
}
Being *ActorManager::createBeing(const int id,
- const ActorSprite::Type type,
+ const ActorType::Type type,
const uint16_t subtype)
{
Being *const being = new Being(id, type, subtype, mMap);
@@ -288,7 +288,7 @@ Being *ActorManager::findBeing(const int id) const
{
ActorSprite *const actor = *it;
if (actor->getId() == id &&
- actor->getType() != ActorSprite::FLOOR_ITEM)
+ actor->getType() != ActorType::FLOOR_ITEM)
{
return static_cast<Being*>(actor);
}
@@ -298,7 +298,7 @@ Being *ActorManager::findBeing(const int id) const
}
Being *ActorManager::findBeing(const int x, const int y,
- const ActorSprite::Type type) const
+ const ActorType::Type type) const
{
beingActorFinder.x = static_cast<uint16_t>(x);
beingActorFinder.y = static_cast<uint16_t>(y);
@@ -329,10 +329,10 @@ Being *ActorManager::findBeingByPixel(const int x, const int y,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::PORTAL)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM)
{
if (!noBeing)
{
@@ -358,7 +358,7 @@ Being *ActorManager::findBeingByPixel(const int x, const int y,
}
if ((being->isAlive()
- || (targetDead && being->getType() == Being::PLAYER))
+ || (targetDead && being->getType() == ActorType::PLAYER))
&& (allPlayers || being != player_node))
{
if ((being->getPixelX() - mapTileSize / 2 <= x) &&
@@ -392,8 +392,8 @@ Being *ActorManager::findBeingByPixel(const int x, const int y,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::PORTAL ||
- (*it)->getType() == ActorSprite::FLOOR_ITEM)
+ if ((*it)->getType() == ActorType::PORTAL ||
+ (*it)->getType() == ActorType::FLOOR_ITEM)
{
continue;
}
@@ -434,7 +434,7 @@ void ActorManager::findBeingsByPixel(std::vector<ActorSprite*> &beings,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::PORTAL)
continue;
const Being *const being = dynamic_cast<const Being*>(*it);
@@ -448,9 +448,9 @@ void ActorManager::findBeingsByPixel(std::vector<ActorSprite*> &beings,
ActorSprite *const actor = *it;
if ((being && (being->isAlive()
- || (mTargetDeadPlayers && being->getType() == Being::PLAYER))
+ || (mTargetDeadPlayers && being->getType() == ActorType::PLAYER))
&& (allPlayers || being != player_node))
- || actor->getType() == ActorSprite::FLOOR_ITEM)
+ || actor->getType() == ActorType::FLOOR_ITEM)
{
if ((actor->getPixelX() - xtol <= x) &&
(actor->getPixelX() + xtol > x) &&
@@ -473,7 +473,7 @@ Being *ActorManager::findPortalByTile(const int x, const int y) const
if (!*it)
continue;
- if ((*it)->getType() != ActorSprite::PORTAL)
+ if ((*it)->getType() != ActorType::PORTAL)
continue;
Being *const being = static_cast<Being*>(*it);
@@ -493,7 +493,7 @@ FloorItem *ActorManager::findItem(const int id) const
continue;
if ((*it)->getId() == id &&
- (*it)->getType() == ActorSprite::FLOOR_ITEM)
+ (*it)->getType() == ActorType::FLOOR_ITEM)
{
return static_cast<FloorItem*>(*it);
}
@@ -510,7 +510,7 @@ FloorItem *ActorManager::findItem(const int x, const int y) const
continue;
if ((*it)->getTileX() == x && (*it)->getTileY() == y &&
- (*it)->getType() == ActorSprite::FLOOR_ITEM)
+ (*it)->getType() == ActorType::FLOOR_ITEM)
{
return static_cast<FloorItem*>(*it);
}
@@ -535,7 +535,7 @@ bool ActorManager::pickUpAll(const int x1, const int y1,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
&& ((*it)->getTileX() >= x1 && (*it)->getTileX() <= x2)
&& ((*it)->getTileY() >= y1 && (*it)->getTileY() <= y2))
{
@@ -570,7 +570,7 @@ bool ActorManager::pickUpAll(const int x1, const int y1,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
&& ((*it)->getTileX() >= x1 && (*it)->getTileX() <= x2)
&& ((*it)->getTileY() >= y1 && (*it)->getTileY() <= y2))
{
@@ -632,7 +632,7 @@ bool ActorManager::pickUpNearest(const int x, const int y,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM)
{
FloorItem *const item = static_cast<FloorItem*>(*it);
@@ -671,22 +671,22 @@ bool ActorManager::pickUpNearest(const int x, const int y,
}
Being *ActorManager::findBeingByName(const std::string &name,
- const ActorSprite::Type type) const
+ const ActorType::Type type) const
{
for_actorsm
{
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
+ || (*it)->getType() == ActorType::PORTAL)
{
continue;
}
Being *const being = static_cast<Being*>(*it);
if (being->getName() == name &&
- (type == ActorSprite::UNKNOWN || type == being->getType()))
+ (type == ActorType::UNKNOWN || type == being->getType()))
{
return being;
}
@@ -695,7 +695,7 @@ Being *ActorManager::findBeingByName(const std::string &name,
}
Being *ActorManager::findNearestByName(const std::string &name,
- const Being::Type &type) const
+ const ActorType::Type &type) const
{
if (!player_node)
return nullptr;
@@ -712,8 +712,8 @@ Being *ActorManager::findNearestByName(const std::string &name,
if (reportTrue(!*it))
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
+ || (*it)->getType() == ActorType::PORTAL)
{
continue;
}
@@ -721,9 +721,9 @@ Being *ActorManager::findNearestByName(const std::string &name,
Being *const being = static_cast<Being*>(*it);
if (being && being->getName() == name &&
- (type == Being::UNKNOWN || type == being->getType()))
+ (type == ActorType::UNKNOWN || type == being->getType()))
{
- if (being->getType() == Being::PLAYER)
+ if (being->getType() == ActorType::PLAYER)
{
return being;
}
@@ -770,7 +770,7 @@ void ActorManager::logic()
if (!*it)
continue;
- if ((*it) && (*it)->getType() == Being::PLAYER)
+ if ((*it) && (*it)->getType() == ActorType::PLAYER)
{
const Being *const being = static_cast<const Being*>(*it);
being->addToCache();
@@ -823,7 +823,7 @@ void ActorManager::clear()
Being *ActorManager::findNearestLivingBeing(const int x, const int y,
const int maxTileDist,
- const ActorSprite::Type type,
+ const ActorType::Type type,
const Being *const excluded) const
{
const int maxDist = maxTileDist * mapTileSize;
@@ -833,7 +833,7 @@ Being *ActorManager::findNearestLivingBeing(const int x, const int y,
Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
const int maxDist,
- const Being::Type type) const
+ const ActorType::Type type) const
{
if (!aroundBeing)
return nullptr;
@@ -844,7 +844,7 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
int maxDist,
- const Being::Type &type,
+ const ActorType::Type &type,
const int x, const int y,
const Being *const excluded) const
{
@@ -869,12 +869,12 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
maxDist = maxDist * maxDist;
- const bool cycleSelect = (mCyclePlayers && type == Being::PLAYER)
- || (mCycleMonsters && type == Being::MONSTER)
- || (mCycleNPC && type == Being::NPC);
+ const bool cycleSelect = (mCyclePlayers && type == ActorType::PLAYER)
+ || (mCycleMonsters && type == ActorType::MONSTER)
+ || (mCycleNPC && type == ActorType::NPC);
const bool filtered = config.getBoolValue("enableAttackFilter")
- && type == Being::MONSTER;
+ && type == ActorType::MONSTER;
const bool modActive = inputManager.isActionActive(Input::KEY_STOP_ATTACK);
bool ignoreDefault = false;
@@ -909,8 +909,8 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
if (!*i)
continue;
- if ((*i)->getType() == ActorSprite::FLOOR_ITEM
- || (*i)->getType() == ActorSprite::PORTAL)
+ if ((*i)->getType() == ActorType::FLOOR_ITEM
+ || (*i)->getType() == ActorType::PORTAL)
{
continue;
}
@@ -974,7 +974,7 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
{
Being *const target = sortedBeings.at(0);
- if (specialDistance && target->getType() == Being::MONSTER
+ if (specialDistance && target->getType() == ActorType::MONSTER
&& target->getDistance() <= 2)
{
return nullptr;
@@ -1007,8 +1007,8 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
if (!*i)
continue;
- if ((*i)->getType() == ActorSprite::FLOOR_ITEM
- || (*i)->getType() == ActorSprite::PORTAL)
+ if ((*i)->getType() == ActorType::FLOOR_ITEM
+ || (*i)->getType() == ActorType::PORTAL)
{
continue;
}
@@ -1038,7 +1038,7 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
const bool valid = validateBeing(aroundBeing, being,
type, excluded, 50);
int d = being->getDistance();
- if (being->getType() != Being::MONSTER || !mTargetOnlyReachable)
+ if (being->getType() != ActorType::MONSTER || !mTargetOnlyReachable)
{ // if distance not calculated, use old distance
d = (being->getTileX() - x) * (being->getTileX() - x)
+ (being->getTileY() - y) * (being->getTileY() - y);
@@ -1107,17 +1107,17 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
bool ActorManager::validateBeing(const Being *const aroundBeing,
Being *const being,
- const Being::Type &type,
+ const ActorType::Type &type,
const Being* const excluded,
const int maxCost) const
{
if (!player_node)
return false;
return being && ((being->getType() == type
- || type == Being::UNKNOWN) && (being->isAlive()
- || (mTargetDeadPlayers && type == Being::PLAYER))
+ || type == ActorType::UNKNOWN) && (being->isAlive()
+ || (mTargetDeadPlayers && type == ActorType::PLAYER))
&& being != aroundBeing) && being != excluded
- && (type != Being::MONSTER || !mTargetOnlyReachable
+ && (type != ActorType::MONSTER || !mTargetOnlyReachable
|| player_node->isReachable(being, maxCost));
}
@@ -1155,7 +1155,7 @@ void ActorManager::heal(const Being *const target) const
{
if (PlayerInfo::getAttribute(Attributes::MP) >= 6)
{
- if (target && target->getType() != Being::MONSTER)
+ if (target && target->getType() != ActorType::MONSTER)
{
if (!client->limitPackets(PACKET_CHAT))
return;
@@ -1176,7 +1176,7 @@ void ActorManager::heal(const Being *const target) const
{
// mp > 10 and target not monster
if (PlayerInfo::getAttribute(Attributes::MP) >= 10 && target
- && target->getType() != Being::MONSTER)
+ && target->getType() != ActorType::MONSTER)
{
// target not enemy
if (player_relations.getRelation(target->getName()) !=
@@ -1196,7 +1196,7 @@ void ActorManager::heal(const Being *const target) const
}
}
// heal self if selected monster or selection empty
- else if ((!target || target->getType() == Being::MONSTER)
+ else if ((!target || target->getType() == ActorType::MONSTER)
&& PlayerInfo::getAttribute(Attributes::MP) >= 6
&& PlayerInfo::getAttribute(Attributes::HP)
!= PlayerInfo::getAttribute(Attributes::MAX_HP))
@@ -1267,7 +1267,7 @@ void ActorManager::printBeingsToChat(const ActorSprites &beings,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM)
continue;
const Being *const being = static_cast<const Being*>(*it);
@@ -1312,15 +1312,15 @@ void ActorManager::getPlayerNames(StringVect &names,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
+ || (*it)->getType() == ActorType::PORTAL)
{
continue;
}
const Being *const being = static_cast<const Being*>(*it);
- if ((being->getType() == ActorSprite::PLAYER
- || (being->getType() == ActorSprite::NPC && npcNames))
+ if ((being->getType() == ActorType::PLAYER
+ || (being->getType() == ActorType::NPC && npcNames))
&& being->getName() != "")
{
names.push_back(being->getName());
@@ -1337,14 +1337,14 @@ void ActorManager::getMobNames(StringVect &names) const
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
+ || (*it)->getType() == ActorType::PORTAL)
{
continue;
}
const Being *const being = static_cast<const Being*>(*it);
- if (being->getType() == ActorSprite::MONSTER && being->getName() != "")
+ if (being->getType() == ActorType::MONSTER && being->getName() != "")
names.push_back(being->getName());
}
}
@@ -1356,15 +1356,15 @@ void ActorManager::updatePlayerNames() const
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
+ || (*it)->getType() == ActorType::PORTAL)
{
continue;
}
Being *const being = static_cast<Being*>(*it);
being->setGoodStatus(-1);
- if (being->getType() == ActorSprite::PLAYER && being->getName() != "")
+ if (being->getType() == ActorType::PLAYER && being->getName() != "")
being->updateName();
}
}
@@ -1376,14 +1376,14 @@ void ActorManager::updatePlayerColors() const
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
+ || (*it)->getType() == ActorType::PORTAL)
{
continue;
}
Being *const being = static_cast<Being*>(*it);
- if (being->getType() == ActorSprite::PLAYER && being->getName() != "")
+ if (being->getType() == ActorType::PLAYER && being->getName() != "")
being->updateColors();
}
}
@@ -1395,14 +1395,14 @@ void ActorManager::updatePlayerGuild() const
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM
+ || (*it)->getType() == ActorType::PORTAL)
{
continue;
}
Being *const being = static_cast<Being*>(*it);
- if (being->getType() == ActorSprite::PLAYER && being->getName() != "")
+ if (being->getType() == ActorType::PLAYER && being->getName() != "")
being->updateGuild();
}
}
@@ -1423,7 +1423,7 @@ void ActorManager::parseLevels(std::string levels) const
if (bktPos != std::string::npos)
{
Being *const being = findBeingByName(part.substr(0, bktPos),
- Being::PLAYER);
+ ActorType::PLAYER);
if (being)
{
being->setLevel(atoi(part.substr(bktPos + 1).c_str()));
@@ -1662,7 +1662,7 @@ void ActorManager::updateEffects(const std::map<int, int> &addEffects,
{
for_actorsm
{
- if (!*it || (*it)->getType() != ActorSprite::NPC)
+ if (!*it || (*it)->getType() != ActorType::NPC)
continue;
Being *const being = static_cast<Being*>(*it);
const int type = being->getSubType();
diff --git a/src/actormanager.h b/src/actormanager.h
index df5d7ab38..00be468a1 100644
--- a/src/actormanager.h
+++ b/src/actormanager.h
@@ -58,7 +58,8 @@ class ActorManager final: public ConfigListener
/**
* Create a Being and add it to the list of ActorSprites.
*/
- Being *createBeing(const int id, const ActorSprite::Type type,
+ Being *createBeing(const int id,
+ const ActorType::Type type,
const uint16_t subtype) A_WARN_UNUSED;
/**
@@ -87,8 +88,8 @@ class ActorManager final: public ConfigListener
/**
* Returns a being at specific coordinates.
*/
- Being *findBeing(const int x, const int y, const ActorSprite::Type
- type = ActorSprite::UNKNOWN) const A_WARN_UNUSED;
+ Being *findBeing(const int x, const int y, const ActorType::Type
+ type = ActorType::UNKNOWN) const A_WARN_UNUSED;
/**
* Returns a being at the specific pixel.
@@ -130,8 +131,8 @@ class ActorManager final: public ConfigListener
*/
Being *findNearestLivingBeing(const int x, const int y,
int maxTileDist,
- const ActorSprite::Type
- type = Being::UNKNOWN,
+ const ActorType::Type
+ type = ActorType::UNKNOWN,
const Being *const
excluded = nullptr) const A_WARN_UNUSED;
@@ -145,22 +146,22 @@ class ActorManager final: public ConfigListener
*/
Being *findNearestLivingBeing(const Being *const aroundBeing,
const int maxTileDist,
- const ActorSprite::Type
- type = Being::UNKNOWN)
+ const ActorType::Type
+ type = ActorType::UNKNOWN)
const A_WARN_UNUSED;
/**
* Finds a being by name and (optionally) by type.
*/
Being *findBeingByName(const std::string &name,
- const ActorSprite::Type
- type = Being::UNKNOWN) const A_WARN_UNUSED;
+ const ActorType::Type
+ type = ActorType::UNKNOWN) const A_WARN_UNUSED;
/**
* Finds a nearest being by name and (optionally) by type.
*/
Being *findNearestByName(const std::string &name,
- const Being::Type &type = Being::UNKNOWN)
+ const ActorType::Type &type = ActorType::UNKNOWN)
const A_WARN_UNUSED;
/**
@@ -170,7 +171,7 @@ class ActorManager final: public ConfigListener
* no being is returned
*/
// void HealAllTargets(Being *aroundBeing, int maxdist,
-// Being::Type type) const;
+// ActorType::Type type) const;
void healTarget() const;
@@ -308,13 +309,13 @@ class ActorManager final: public ConfigListener
protected:
bool validateBeing(const Being *const aroundBeing,
Being *const being,
- const Being::Type &type,
+ const ActorType::Type &type,
const Being *const excluded = nullptr,
const int maxCost = 20) const A_WARN_UNUSED;
Being *findNearestLivingBeing(const Being *const aroundBeing,
const int maxdist,
- const Being::Type &type,
+ const ActorType::Type &type,
const int x, const int y,
const Being *const
excluded = nullptr) const A_WARN_UNUSED;
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index ece1320f8..eb695a0e2 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -203,7 +203,7 @@ void ActorSprite::updateStatusEffect(const int index, const bool newStatus)
index, newStatus);
if (!effect)
return;
- if (effect->isPoison() && getType() == PLAYER)
+ if (effect->isPoison() && getType() == ActorType::PLAYER)
setPoison(newStatus);
handleStatusEffect(effect, index);
}
diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h
index 42623027d..5b9c438d8 100644
--- a/src/being/actorsprite.h
+++ b/src/being/actorsprite.h
@@ -28,6 +28,7 @@
#include "resources/map/mapconsts.h"
#include "being/actor.h"
+#include "being/actortype.h"
#include "being/compoundsprite.h"
#include "particle/particlecontainer.h"
@@ -44,18 +45,6 @@ class ActorSpriteListener;
class ActorSprite : public CompoundSprite, public Actor
{
public:
- enum Type
- {
- UNKNOWN = 0,
- PLAYER,
- NPC,
- MONSTER,
- FLOOR_ITEM,
- PORTAL,
- PET,
- AVATAR
- };
-
enum TargetCursorSize
{
TC_SMALL = 0,
@@ -87,8 +76,8 @@ public:
/**
* Returns the type of the ActorSprite.
*/
- virtual Type getType() const A_WARN_UNUSED
- { return UNKNOWN; }
+ virtual ActorType::Type getType() const A_WARN_UNUSED
+ { return ActorType::UNKNOWN; }
void draw1(Graphics *const graphics,
const int offsetX,
diff --git a/src/being/actortype.h b/src/being/actortype.h
new file mode 100644
index 000000000..794dae5f2
--- /dev/null
+++ b/src/being/actortype.h
@@ -0,0 +1,40 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2010 The Mana Developers
+ * Copyright (C) 2011-2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef BEING_ACTORTYPE_H
+#define BEING_ACTORTYPE_H
+
+namespace ActorType
+{
+ enum Type
+ {
+ UNKNOWN = 0,
+ PLAYER,
+ NPC,
+ MONSTER,
+ FLOOR_ITEM,
+ PORTAL,
+ PET,
+ AVATAR
+ };
+}
+
+#endif // BEING_ACTORTYPE_H
diff --git a/src/being/being.cpp b/src/being/being.cpp
index eb2c4682f..a494df61e 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -108,7 +108,9 @@ std::list<BeingCacheEntry*> beingInfoCache;
typedef std::map<int, Guild*>::const_iterator GuildsMapCIter;
typedef std::map<int, int>::const_iterator IntMapCIter;
-Being::Being(const int id, const Type type, const uint16_t subtype,
+Being::Being(const int id,
+ const ActorType::Type type,
+ const uint16_t subtype,
Map *const map) :
ActorSprite(id),
mNextSound(),
@@ -207,16 +209,16 @@ Being::Being(const int id, const Type type, const uint16_t subtype,
setMap(map);
setSubtype(subtype, 0);
- if (mType == PLAYER)
+ if (mType == ActorType::PLAYER)
mShowName = config.getBoolValue("visiblenames");
- else if (mType != NPC)
+ else if (mType != ActorType::NPC)
mGotComment = true;
config.addListener("visiblenames", this);
reReadConfig();
- if (mType == NPC)
+ if (mType == ActorType::NPC)
setShowName(true);
else
setShowName(mShowName);
@@ -271,7 +273,7 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look)
mSubType = subtype;
mLook = look;
- if (mType == MONSTER)
+ if (mType == ActorType::MONSTER)
{
mInfo = MonsterDB::get(mSubType);
if (mInfo)
@@ -282,7 +284,7 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look)
mYDiff = mInfo->getSortOffsetY();
}
}
- else if (mType == NPC)
+ else if (mType == ActorType::NPC)
{
mInfo = NPCDB::get(mSubType);
if (mInfo)
@@ -291,13 +293,13 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look)
mYDiff = mInfo->getSortOffsetY();
}
}
- else if (mType == AVATAR)
+ else if (mType == ActorType::AVATAR)
{
mInfo = AvatarDB::get(mSubType);
if (mInfo)
setupSpriteDisplay(mInfo->getDisplay(), false);
}
- else if (mType == PET)
+ else if (mType == ActorType::PET)
{
mInfo = PETDB::get(mId);
if (mInfo)
@@ -317,7 +319,7 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look)
}
}
}
- else if (mType == PLAYER)
+ else if (mType == ActorType::PLAYER)
{
int id = -100 - subtype;
@@ -526,7 +528,7 @@ void Being::takeDamage(Being *const attacker, const int amount,
color = &userPalette->getColor(UserPalette::MISS);
}
}
- else if (mType == MONSTER)
+ else if (mType == ActorType::MONSTER)
{
if (attacker == player_node)
{
@@ -539,7 +541,7 @@ void Being::takeDamage(Being *const attacker, const int amount,
UserPalette::HIT_PLAYER_MONSTER);
}
}
- else if (mType == PLAYER && attacker != player_node
+ else if (mType == ActorType::PLAYER && attacker != player_node
&& this == player_node)
{
// here player was attacked by other player. mark him as enemy.
@@ -556,7 +558,7 @@ void Being::takeDamage(Being *const attacker, const int amount,
{
if (this == player_node)
{
- if (attacker->mType == PLAYER || amount)
+ if (attacker->mType == ActorType::PLAYER || amount)
{
chatWindow->battleChatLog(strprintf("%s : Hit you -%d",
attacker->getName().c_str(), amount), BY_OTHER);
@@ -602,12 +604,12 @@ void Being::takeDamage(Being *const attacker, const int amount,
mHP = 0;
}
- if (mType == MONSTER)
+ if (mType == ActorType::MONSTER)
{
updatePercentHP();
updateName();
}
- else if (mType == PLAYER && socialWindow && getName() != "")
+ else if (mType == ActorType::PLAYER && socialWindow && getName() != "")
{
socialWindow->updateAvatar(getName());
}
@@ -646,7 +648,7 @@ int Being::getHitEffect(const Being *const attacker,
{
const ItemInfo *const attackerWeapon
= attacker->getEquippedWeapon();
- if (attackerWeapon && attacker->getType() == PLAYER)
+ if (attackerWeapon && attacker->getType() == ActorType::PLAYER)
{
if (type == MISS)
hitEffectId = attackerWeapon->getMissEffectId();
@@ -655,7 +657,7 @@ int Being::getHitEffect(const Being *const attacker,
else
hitEffectId = attackerWeapon->getCriticalHitEffectId();
}
- else if (attacker->getType() == MONSTER)
+ else if (attacker->getType() == ActorType::MONSTER)
{
const BeingInfo *const info = attacker->getInfo();
if (info)
@@ -716,7 +718,7 @@ void Being::handleAttack(Being *const victim, const int damage,
mLastAttackX = victim->getTileX();
mLastAttackY = victim->getTileY();
- if (mType == PLAYER && mEquippedWeapon)
+ if (mType == ActorType::PLAYER && mEquippedWeapon)
fireMissile(victim, mEquippedWeapon->getMissileParticleFile());
else if (mInfo->getAttack(attackId))
fireMissile(victim, mInfo->getAttack(attackId)->mMissileParticle);
@@ -731,13 +733,13 @@ void Being::handleAttack(Being *const victim, const int damage,
if (dir)
setDirection(dir);
}
- if (damage && victim->mType == PLAYER
+ if (damage && victim->mType == ActorType::PLAYER
&& victim->mAction == BeingAction::SIT)
{
victim->setAction(BeingAction::STAND, 0);
}
- if (mType == PLAYER)
+ if (mType == ActorType::PLAYER)
{
if (mSpriteIDs.size() >= 10)
{
@@ -782,7 +784,7 @@ void Being::handleSkill(Being *const victim, const int damage,
if (dir)
setDirection(dir);
}
- if (damage && victim->mType == PLAYER
+ if (damage && victim->mType == ActorType::PLAYER
&& victim->mAction == BeingAction::SIT)
{
victim->setAction(BeingAction::STAND, 0);
@@ -803,7 +805,7 @@ void Being::handleSkill(Being *const victim, const int damage,
void Being::setName(const std::string &name)
{
- if (mType == NPC)
+ if (mType == ActorType::NPC)
{
mName = name.substr(0, name.find('#', 0));
showName();
@@ -812,7 +814,7 @@ void Being::setName(const std::string &name)
{
mName = name;
- if (mType == PLAYER && getShowName())
+ if (mType == ActorType::PLAYER && getShowName())
showName();
}
}
@@ -1200,7 +1202,7 @@ void Being::setAction(const BeingAction::Action &action, const int attackId)
if (mInfo)
{
playSfx(mInfo->getSound(SOUND_EVENT_DIE), this, false, mX, mY);
- if (mType == MONSTER || mType == NPC)
+ if (mType == ActorType::MONSTER || mType == ActorType::NPC)
mYDiff = mInfo->getDeadSortOffsetY();
}
break;
@@ -1341,10 +1343,15 @@ void Being::nextTile()
}
mActionTime += static_cast<int>(mSpeed / 10);
- if ((mType != PLAYER || mUseDiagonal) && mX != pos.x && mY != pos.y)
+ if ((mType != ActorType::PLAYER || mUseDiagonal)
+ && mX != pos.x && mY != pos.y)
+ {
mSpeed = static_cast<float>(mWalkSpeed.x * 1.4F);
+ }
else
+ {
mSpeed = mWalkSpeed.x;
+ }
if (mX != pos.x || mY != pos.y)
mOldHeight = mMap->getHeightOffset(mX, mY);
@@ -1458,7 +1465,7 @@ void Being::logic()
&& static_cast<int> ((static_cast<float>(get_elapsed_time(mActionTime))
/ mSpeed)) >= frameCount)
{
- if (mType != PLAYER && actorManager)
+ if (mType != ActorType::PLAYER && actorManager)
actorManager->destroy(this);
}
@@ -1759,7 +1766,7 @@ void Being::updateCoords()
offsetY += mInfo->getNameOffsetY();
}
// Monster names show above the sprite instead of below it
- if (mType == MONSTER)
+ if (mType == ActorType::MONSTER)
offsetY += - getHeight() - mDispName->getHeight();
mDispName->adviseXY(offsetX, offsetY, mMoveNames);
@@ -1767,7 +1774,7 @@ void Being::updateCoords()
void Being::optionChanged(const std::string &value)
{
- if (mType == PLAYER && value == "visiblenames")
+ if (mType == ActorType::PLAYER && value == "visiblenames")
setShowName(config.getBoolValue("visiblenames"));
}
@@ -1829,7 +1836,7 @@ void Being::showName()
std::string displayName(mName);
- if (mType != MONSTER && (mShowGender || mShowLevel))
+ if (mType != ActorType::MONSTER && (mShowGender || mShowLevel))
{
displayName.append(" ");
if (mShowLevel && getLevel() != 0)
@@ -1838,7 +1845,7 @@ void Being::showName()
displayName.append(getGenderSign());
}
- if (mType == MONSTER)
+ if (mType == ActorType::MONSTER)
{
if (config.getBoolValue("showMonstersTakedDamage"))
displayName.append(", ").append(toString(getDamageTaken()));
@@ -1846,11 +1853,12 @@ void Being::showName()
Font *font = nullptr;
if (player_node && player_node->getTarget() == this
- && mType != MONSTER)
+ && mType != ActorType::MONSTER)
{
font = boldFont;
}
- else if (mType == PLAYER && !player_relations.isGoodName(this) && gui)
+ else if (mType == ActorType::PLAYER
+ && !player_relations.isGoodName(this) && gui)
{
font = gui->getSecureFont();
}
@@ -1875,12 +1883,12 @@ void Being::updateColors()
{
if (userPalette)
{
- if (mType == MONSTER)
+ if (mType == ActorType::MONSTER)
{
mNameColor = &userPalette->getColor(UserPalette::MONSTER);
mTextColor = &userPalette->getColor(UserPalette::MONSTER);
}
- else if (mType == NPC)
+ else if (mType == ActorType::NPC)
{
mNameColor = &userPalette->getColor(UserPalette::NPC);
mTextColor = &userPalette->getColor(UserPalette::NPC);
@@ -2003,7 +2011,7 @@ void Being::setSprite(const unsigned int slot, const int id,
if (id1)
{
const ItemInfo &info = ItemDB::get(id1);
- if (!isTempSprite && mMap && mType == PLAYER)
+ if (!isTempSprite && mMap && mType == ActorType::PLAYER)
{
const int pet = info.getPet();
if (pet)
@@ -2018,7 +2026,7 @@ void Being::setSprite(const unsigned int slot, const int id,
const std::string &filename = info.getSprite(mGender, mSubType);
AnimatedSprite *equipmentSprite = nullptr;
- if (!isTempSprite && mType == PLAYER)
+ if (!isTempSprite && mType == ActorType::PLAYER)
{
const int pet = info.getPet();
if (pet)
@@ -2189,7 +2197,7 @@ bool Being::updateFromCache()
}
updateAwayEffect();
- if (mType == PLAYER)
+ if (mType == ActorType::PLAYER)
updateColors();
return true;
}
@@ -2371,7 +2379,7 @@ void Being::drawSpriteAt(Graphics *const graphics,
}
}
- if (mHighlightMonsterAttackRange && mType == ActorSprite::MONSTER
+ if (mHighlightMonsterAttackRange && mType == ActorType::MONSTER
&& isAlive())
{
int attackRange;
@@ -2389,7 +2397,7 @@ void Being::drawSpriteAt(Graphics *const graphics,
}
if (mShowMobHP && mInfo && player_node && player_node->getTarget() == this
- && mType == MONSTER)
+ && mType == ActorType::MONSTER)
{
// show hp bar here
int maxHP = mMaxHP;
@@ -2494,7 +2502,7 @@ void Being::setHP(const int hp)
mHP = hp;
if (mMaxHP < mHP)
mMaxHP = mHP;
- if (mType == MONSTER)
+ if (mType == ActorType::MONSTER)
updatePercentHP();
}
@@ -2882,10 +2890,10 @@ std::string Being::loadComment(const std::string &name, const int type)
std::string str;
switch (type)
{
- case PLAYER:
+ case ActorType::PLAYER:
str = client->getUsersDirectory();
break;
- case NPC:
+ case ActorType::NPC:
str = client->getNpcsDirectory();
break;
default:
@@ -2911,10 +2919,10 @@ void Being::saveComment(const std::string &restrict name,
std::string dir;
switch (type)
{
- case PLAYER:
+ case ActorType::PLAYER:
dir = client->getUsersDirectory();
break;
- case NPC:
+ case ActorType::NPC:
dir = client->getNpcsDirectory();
break;
default:
@@ -3098,7 +3106,7 @@ void Being::addPet(const int id)
}
Being *const being = actorManager->createBeing(
- id, ActorSprite::PET, 0);
+ id, ActorType::PET, 0);
if (being)
{
being->setOwner(this);
@@ -3290,7 +3298,7 @@ void Being::playSfx(const SoundInfo &sound, Being *const being,
void Being::setLook(const uint8_t look)
{
- if (mType == PLAYER)
+ if (mType == ActorType::PLAYER)
setSubtype(mSubType, look);
}
diff --git a/src/being/being.h b/src/being/being.h
index 52a88bd2e..dfa920e68 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -111,14 +111,16 @@ class Being : public ActorSprite, public ConfigListener
* @param subtype partly determines the type of the being
* @param map the map the being is on
*/
- Being(const int id, const Type type, const uint16_t subtype,
+ Being(const int id,
+ const ActorType::Type type,
+ const uint16_t subtype,
Map *const map);
A_DELETE_COPY(Being)
virtual ~Being();
- Type getType() const A_WARN_UNUSED
+ ActorType::Type getType() const override final A_WARN_UNUSED
{ return mType; }
/**
@@ -630,7 +632,7 @@ class Being : public ActorSprite, public ConfigListener
void setGM(const bool gm);
bool canTalk() const A_WARN_UNUSED
- { return mType == NPC; }
+ { return mType == ActorType::NPC; }
void talkTo() const;
@@ -981,7 +983,7 @@ class Being : public ActorSprite, public ConfigListener
void dumpSprites() const;
- const Type mType;
+ const ActorType::Type mType;
/** Speech Bubble components */
SpeechBubble *mSpeechBubble;
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 2774ab86e..d22e8503c 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -101,7 +101,7 @@ extern MiniStatusWindow *miniStatusWindow;
extern SkillDialog *skillDialog;
LocalPlayer::LocalPlayer(const int id, const int subtype) :
- Being(id, PLAYER, subtype, nullptr),
+ Being(id, ActorType::PLAYER, subtype, nullptr),
AttributeListener(),
StatListener(),
mGMLevel(0),
@@ -295,7 +295,7 @@ void LocalPlayer::logic()
if (mTarget)
{
- if (mTarget->getType() == ActorSprite::NPC)
+ if (mTarget->getType() == ActorType::NPC)
{
// NPCs are always in range
mTarget->setTargetType(TCT_IN_RANGE);
@@ -314,7 +314,7 @@ void LocalPlayer::logic()
mTarget->setTargetType(targetType);
if (!mTarget->isAlive() && (!mTargetDeadPlayers
- || mTarget->getType() != Being::PLAYER))
+ || mTarget->getType() != ActorType::PLAYER))
{
stopAttack(true);
}
@@ -532,7 +532,7 @@ void LocalPlayer::setTarget(Being *const target)
oldTarget = mTarget;
}
- if (mTarget && mTarget->getType() == ActorSprite::MONSTER)
+ if (mTarget && mTarget->getType() == ActorType::MONSTER)
mTarget->setShowName(false);
mTarget = target;
@@ -547,7 +547,7 @@ void LocalPlayer::setTarget(Being *const target)
mTarget->updateName();
}
- if (target && target->getType() == ActorSprite::MONSTER)
+ if (target && target->getType() == ActorType::MONSTER)
target->setShowName(true);
}
@@ -731,7 +731,7 @@ void LocalPlayer::attack(Being *const target, const bool keep,
{
mKeepAttacking = keep;
- if (!target || target->getType() == ActorSprite::NPC)
+ if (!target || target->getType() == ActorType::NPC)
return;
if (mTarget != target)
@@ -761,7 +761,7 @@ void LocalPlayer::attack(Being *const target, const bool keep,
mActionTime = tick_time;
- if (target->getType() != Being::PLAYER || checAttackPermissions(target))
+ if (target->getType() != ActorType::PLAYER || checAttackPermissions(target))
{
setAction(BeingAction::ATTACK);
@@ -3297,7 +3297,7 @@ void LocalPlayer::attack2(Being *const target, const bool keep,
return;
}
setTarget(target);
- if (target->getType() != Being::NPC)
+ if (target->getType() != ActorType::NPC)
{
mKeepAttacking = true;
moveToTarget();
@@ -3510,7 +3510,7 @@ void LocalPlayer::followMoveTo(const Being *const being,
if (actorManager)
{
Being *const b = actorManager->findBeingByName(
- mPlayerFollowed, Being::PLAYER);
+ mPlayerFollowed, ActorType::PLAYER);
setTarget(b);
}
}
@@ -3665,7 +3665,7 @@ void LocalPlayer::checkNewName(Being *const being)
return;
const std::string &nick = being->getName();
- if (being->getType() == ActorSprite::PLAYER)
+ if (being->getType() == ActorType::PLAYER)
{
const Guild *const guild = getGuild();
if (guild)
diff --git a/src/being/playerrelations.cpp b/src/being/playerrelations.cpp
index cdba9bfb6..486713434 100644
--- a/src/being/playerrelations.cpp
+++ b/src/being/playerrelations.cpp
@@ -249,9 +249,9 @@ void PlayerRelationsManager::signalUpdate(const std::string &name)
if (actorManager)
{
Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
- if (being && being->getType() == Being::PLAYER)
+ if (being && being->getType() == ActorType::PLAYER)
being->updateColors();
}
}
@@ -300,7 +300,7 @@ bool PlayerRelationsManager::hasPermission(const Being *const being,
if (!being)
return false;
- if (being->getType() == ActorSprite::PLAYER)
+ if (being->getType() == ActorType::PLAYER)
return hasPermission(being->getName(), flags) == flags;
return true;
}
@@ -321,9 +321,9 @@ bool PlayerRelationsManager::hasPermission(const std::string &name,
if (mIgnoreStrategy)
{
Being *const b = actorManager->findBeingByName(
- name, ActorSprite::PLAYER);
+ name, ActorType::PLAYER);
- if (b && b->getType() == ActorSprite::PLAYER)
+ if (b && b->getType() == ActorType::PLAYER)
mIgnoreStrategy->ignore(b, rejections);
}
}
diff --git a/src/commands.cpp b/src/commands.cpp
index 508c78e4e..f3ea4eff7 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -670,7 +670,7 @@ impHandler0(attackHuman)
return;
Being *const target = actorManager->findNearestLivingBeing(
- player_node, 10, ActorSprite::PLAYER);
+ player_node, 10, ActorType::PLAYER);
if (target)
{
if (player_node->checAttackPermissions(target))
@@ -783,7 +783,7 @@ impHandler1(heal)
if (!args.empty())
{
const Being *const being = actorManager->findBeingByName(
- args, Being::PLAYER);
+ args, ActorType::PLAYER);
if (being)
actorManager->heal(being);
}
@@ -848,7 +848,7 @@ impHandler1(trade)
return;
const Being *const being = actorManager->findBeingByName(
- args, Being::PLAYER);
+ args, ActorType::PLAYER);
if (being)
{
Net::getTradeHandler()->request(being);
@@ -1530,10 +1530,10 @@ void replaceVars(std::string &str)
if (str.find("<PLAYER>") != std::string::npos)
{
const Being *target = player_node->getTarget();
- if (!target || target->getType() != ActorSprite::PLAYER)
+ if (!target || target->getType() != ActorType::PLAYER)
{
target = actorManager->findNearestLivingBeing(
- player_node, 20, ActorSprite::PLAYER);
+ player_node, 20, ActorType::PLAYER);
}
if (target)
replaceAll(str, "<PLAYER>", target->getName());
@@ -1543,10 +1543,10 @@ void replaceVars(std::string &str)
if (str.find("<MONSTER>") != std::string::npos)
{
const Being *target = player_node->getTarget();
- if (!target || target->getType() != ActorSprite::MONSTER)
+ if (!target || target->getType() != ActorType::MONSTER)
{
target = actorManager->findNearestLivingBeing(
- player_node, 20, ActorSprite::MONSTER);
+ player_node, 20, ActorType::MONSTER);
}
if (target)
replaceAll(str, "<MONSTER>", target->getName());
diff --git a/src/flooritem.h b/src/flooritem.h
index 65fdbcfb4..c884d8db3 100644
--- a/src/flooritem.h
+++ b/src/flooritem.h
@@ -52,8 +52,8 @@ class FloorItem final : public ActorSprite
void postInit(Map *const map, int subX, int subY);
- Type getType() const override final A_WARN_UNUSED
- { return FLOOR_ITEM; }
+ ActorType::Type getType() const override final A_WARN_UNUSED
+ { return ActorType::FLOOR_ITEM; }
void draw(Graphics *const graphics,
const int offsetX, const int offsetY) const override final;
diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp
index 07d4b064a..dd1aaf028 100644
--- a/src/gui/popups/beingpopup.cpp
+++ b/src/gui/popups/beingpopup.cpp
@@ -94,7 +94,7 @@ void BeingPopup::show(const int x, const int y, Being *const b)
b->updateComment();
- if (b->getType() == Being::NPC && b->getComment().empty())
+ if (b->getType() == ActorType::NPC && b->getComment().empty())
{
setVisible(false);
return;
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index f997c0549..524758719 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -112,7 +112,7 @@ PopupMenu::PopupMenu() :
mButton(nullptr),
mNick(),
mTextField(nullptr),
- mType(static_cast<int>(Being::UNKNOWN)),
+ mType(static_cast<int>(ActorType::UNKNOWN)),
mX(0),
mY(0)
{
@@ -122,7 +122,7 @@ PopupMenu::PopupMenu() :
mRenameListener.setDialog(nullptr);
mPlayerListener.setNick("");
mPlayerListener.setDialog(nullptr);
- mPlayerListener.setType(static_cast<int>(Being::UNKNOWN));
+ mPlayerListener.setType(static_cast<int>(ActorType::UNKNOWN));
mScrollArea = new ScrollArea(this, mBrowserBox, false);
mScrollArea->setVerticalScrollPolicy(ScrollArea::SHOW_AUTO);
}
@@ -149,7 +149,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
switch (being->getType())
{
- case ActorSprite::PLAYER:
+ case ActorType::PLAYER:
{
// TRANSLATORS: popup menu item
// TRANSLATORS: trade with player
@@ -234,7 +234,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
break;
}
- case ActorSprite::NPC:
+ case ActorType::NPC:
// NPCs can be talked to (single option, candidate for removal
// unless more options would be added)
// TRANSLATORS: popup menu item
@@ -255,7 +255,7 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
mBrowserBox->addRow("addcomment", _("Add comment"));
break;
- case ActorSprite::MONSTER:
+ case ActorType::MONSTER:
{
// Monsters can be attacked
// TRANSLATORS: popup menu item
@@ -293,11 +293,11 @@ void PopupMenu::showPopup(const int x, const int y, const Being *const being)
break;
}
- case ActorSprite::AVATAR:
- case ActorSprite::UNKNOWN:
- case ActorSprite::FLOOR_ITEM:
- case ActorSprite::PORTAL:
- case ActorSprite::PET:
+ case ActorType::AVATAR:
+ case ActorType::UNKNOWN:
+ case ActorType::FLOOR_ITEM:
+ case ActorType::PORTAL:
+ case ActorType::PET:
default:
break;
}
@@ -331,7 +331,7 @@ void PopupMenu::showPopup(const int x, const int y,
static_cast<unsigned>(being->getId()), (being->getName()
+ being->getGenderSignWithSpace()).c_str()));
}
- else if (actor->getType() == ActorSprite::FLOOR_ITEM)
+ else if (actor->getType() == ActorType::FLOOR_ITEM)
{
const FloorItem *const floorItem
= static_cast<const FloorItem*>(actor);
@@ -355,7 +355,7 @@ void PopupMenu::showPlayerPopup(const int x, const int y,
mNick = nick;
mBeingId = 0;
- mType = static_cast<int>(Being::PLAYER);
+ mType = static_cast<int>(ActorType::PLAYER);
mX = x;
mY = y;
mBrowserBox->clearRows();
@@ -455,7 +455,7 @@ void PopupMenu::showPopup(const int x, const int y,
mFloorItemId = floorItem->getId();
mX = x;
mY = y;
- mType = static_cast<int>(Being::FLOOR_ITEM);
+ mType = static_cast<int>(ActorType::FLOOR_ITEM);
mBrowserBox->clearRows();
const std::string name = floorItem->getName();
mNick = name;
@@ -682,7 +682,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
std::string name = wTab->getNick();
const Being* const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
@@ -772,7 +772,7 @@ void PopupMenu::showChatPopup(const int x, const int y, ChatTab *const tab)
else
{
mNick = name;
- mType = static_cast<int>(Being::PLAYER);
+ mType = static_cast<int>(ActorType::PLAYER);
addPlayerRelation(name);
mBrowserBox->addRow("##3---");
addFollow();
@@ -836,7 +836,7 @@ void PopupMenu::showChangePos(const int x, const int y)
mItem = nullptr;
mMapItem = nullptr;
mNick.clear();
- mType = static_cast<int>(Being::UNKNOWN);
+ mType = static_cast<int>(ActorType::UNKNOWN);
mX = 0;
mY = 0;
setVisible(false);
@@ -898,7 +898,7 @@ void PopupMenu::handleLink(const std::string &link,
}
// Trade action
else if (link == "trade" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
Net::getTradeHandler()->request(being);
tradePartnerName = being->getName();
@@ -907,9 +907,9 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "buy" && being && mBeingId != 0)
{
- if (being->getType() == Being::NPC)
+ if (being->getType() == ActorType::NPC)
Net::getNpcHandler()->buy(mBeingId);
- else if (being->getType() == Being::PLAYER)
+ else if (being->getType() == ActorType::PLAYER)
Net::getBuySellHandler()->requestSellList(being->getName());
}
else if (link == "buy" && !mNick.empty())
@@ -918,9 +918,9 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "sell" && being && mBeingId != 0)
{
- if (being->getType() == Being::NPC)
+ if (being->getType() == ActorType::NPC)
Net::getNpcHandler()->sell(mBeingId);
- else if (being->getType() == Being::PLAYER)
+ else if (being->getType() == ActorType::PLAYER)
Net::getBuySellHandler()->requestBuyList(being->getName());
}
else if (link == "sell" && !mNick.empty())
@@ -932,13 +932,13 @@ void PopupMenu::handleLink(const std::string &link,
if (player_node)
player_node->attack(being, true);
}
- else if (link == "heal" && being && being->getType() != Being::MONSTER)
+ else if (link == "heal" && being && being->getType() != ActorType::MONSTER)
{
if (actorManager)
actorManager->heal(being);
}
else if (link == "unignore" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
player_relations.setRelation(being->getName(),
PlayerRelation::NEUTRAL);
@@ -948,7 +948,7 @@ void PopupMenu::handleLink(const std::string &link,
player_relations.setRelation(mNick, PlayerRelation::NEUTRAL);
}
else if (link == "ignore" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
player_relations.setRelation(being->getName(),
PlayerRelation::IGNORED);
@@ -959,7 +959,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "blacklist" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
player_relations.setRelation(being->getName(),
PlayerRelation::BLACKLISTED);
@@ -969,7 +969,7 @@ void PopupMenu::handleLink(const std::string &link,
player_relations.setRelation(mNick, PlayerRelation::BLACKLISTED);
}
else if (link == "enemy" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
player_relations.setRelation(being->getName(),
PlayerRelation::ENEMY2);
@@ -979,7 +979,7 @@ void PopupMenu::handleLink(const std::string &link,
player_relations.setRelation(mNick, PlayerRelation::ENEMY2);
}
else if (link == "erase" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
player_relations.setRelation(being->getName(), PlayerRelation::ERASED);
being->updateName();
@@ -989,7 +989,7 @@ void PopupMenu::handleLink(const std::string &link,
player_relations.setRelation(mNick, PlayerRelation::ERASED);
}
else if (link == "disregard" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
player_relations.setRelation(being->getName(),
PlayerRelation::DISREGARDED);
@@ -999,7 +999,7 @@ void PopupMenu::handleLink(const std::string &link,
player_relations.setRelation(mNick, PlayerRelation::DISREGARDED);
}
else if (link == "friend" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
player_relations.setRelation(being->getName(), PlayerRelation::FRIEND);
}
@@ -1282,12 +1282,12 @@ void PopupMenu::handleLink(const std::string &link,
PlayerInfo::unprotectItem(mItemId);
}
else if (link == "party" && being &&
- being->getType() == ActorSprite::PLAYER)
+ being->getType() == ActorType::PLAYER)
{
Net::getPartyHandler()->invite(being);
}
else if (link == "kick party" && being
- && being->getType() == Being::PLAYER)
+ && being->getType() == ActorType::PLAYER)
{
Net::getPartyHandler()->kick(being);
}
@@ -1308,8 +1308,8 @@ void PopupMenu::handleLink(const std::string &link,
chatWindow->addInputText(name);
}
else if (link == "admin-kick" && being &&
- (being->getType() == ActorSprite::PLAYER ||
- being->getType() == ActorSprite::MONSTER))
+ (being->getType() == ActorType::PLAYER ||
+ being->getType() == ActorType::MONSTER))
{
Net::getAdminHandler()->kick(being->getId());
}
@@ -1475,7 +1475,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "remove attack" && being)
{
- if (actorManager && being->getType() == Being::MONSTER)
+ if (actorManager && being->getType() == ActorType::MONSTER)
{
actorManager->removeAttackMob(being->getName());
if (socialWindow)
@@ -1484,7 +1484,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "add attack" && being)
{
- if (actorManager && being->getType() == Being::MONSTER)
+ if (actorManager && being->getType() == ActorType::MONSTER)
{
actorManager->addAttackMob(being->getName());
if (socialWindow)
@@ -1493,7 +1493,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "add attack priority" && being)
{
- if (actorManager && being->getType() == Being::MONSTER)
+ if (actorManager && being->getType() == ActorType::MONSTER)
{
actorManager->addPriorityAttackMob(being->getName());
if (socialWindow)
@@ -1502,7 +1502,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "add attack ignore" && being)
{
- if (actorManager && being->getType() == Being::MONSTER)
+ if (actorManager && being->getType() == ActorType::MONSTER)
{
actorManager->addIgnoreAttackMob(being->getName());
if (socialWindow)
@@ -1900,7 +1900,7 @@ void PopupMenu::handleLink(const std::string &link,
mButton = nullptr;
mNick.clear();
mTextField = nullptr;
- mType = static_cast<int>(Being::UNKNOWN);
+ mType = static_cast<int>(ActorType::UNKNOWN);
mX = 0;
mY = 0;
}
@@ -2265,7 +2265,7 @@ void PopupMenu::showAttackMonsterPopup(const int x, const int y,
return;
mNick = name;
- mType = static_cast<int>(Being::MONSTER);
+ mType = static_cast<int>(ActorType::MONSTER);
mX = x;
mY = y;
@@ -2343,7 +2343,7 @@ void PopupMenu::showPickupItemPopup(const int x, const int y,
return;
mNick = name;
- mType = static_cast<int>(Being::FLOOR_ITEM);
+ mType = static_cast<int>(ActorType::FLOOR_ITEM);
mX = x;
mY = y;
@@ -2953,7 +2953,7 @@ PlayerListener::PlayerListener() :
ActionListener(),
mNick(),
mDialog(nullptr),
- mType(static_cast<int>(Being::UNKNOWN))
+ mType(static_cast<int>(ActorType::UNKNOWN))
{
}
@@ -2963,7 +2963,7 @@ void PlayerListener::action(const ActionEvent &event)
{
std::string comment = mDialog->getText();
Being *const being = actorManager->findBeingByName(
- mNick, static_cast<ActorSprite::Type>(mType));
+ mNick, static_cast<ActorType::Type>(mType));
if (being)
being->setComment(comment);
Being::saveComment(mNick, comment, mType);
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 35805287b..f8f0c2ec0 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -256,7 +256,7 @@ void Viewport::draw(Graphics *graphics)
const ActorSprites &actors = actorManager->getAll();
FOR_EACH (ActorSpritesIterator, it, actors)
{
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM)
+ if ((*it)->getType() == ActorType::FLOOR_ITEM)
continue;
Being *const b = static_cast<Being*>(*it);
b->drawSpeech(mPixelViewX, mPixelViewY);
@@ -425,8 +425,8 @@ bool Viewport::leftMouseAction()
}
else
{
- const ActorSprite::Type type = mHoverBeing->getType();
- if (type == ActorSprite::PLAYER)
+ const ActorType::Type type = mHoverBeing->getType();
+ if (type == ActorType::PLAYER)
{
validateSpeed();
if (actorManager)
@@ -438,7 +438,7 @@ bool Viewport::leftMouseAction()
return true;
}
}
- else if (type == ActorSprite::MONSTER || type == ActorSprite::NPC)
+ else if (type == ActorType::MONSTER || type == ActorType::NPC)
{
if (player_node->withinAttackRange(mHoverBeing) ||
inputManager.isActionActive(static_cast<int>(
@@ -540,7 +540,7 @@ void Viewport::mousePressed(MouseEvent &event)
if (actorManager)
{
Being *const target = actorManager->findNearestLivingBeing(
- pixelX, pixelY, 20, ActorSprite::MONSTER);
+ pixelX, pixelY, 20, ActorType::MONSTER);
if (target)
player_node->setTarget(target);
@@ -897,14 +897,14 @@ void Viewport::mouseMoved(MouseEvent &event A_UNUSED)
const int x = mMouseX + mPixelViewX;
const int y = mMouseY + mPixelViewY;
- ActorSprite::Type type = ActorSprite::UNKNOWN;
+ ActorType::Type type = ActorType::UNKNOWN;
mHoverBeing = actorManager->findBeingByPixel(x, y, true);
if (mHoverBeing)
type = mHoverBeing->getType();
if (mHoverBeing
- && (type == Being::PLAYER
- || type == Being::NPC
- || type == Being::PET))
+ && (type == ActorType::PLAYER
+ || type == ActorType::NPC
+ || type == ActorType::PET))
{
mTextPopup->setVisible(false);
if (mShowBeingPopup)
@@ -954,23 +954,23 @@ void Viewport::mouseMoved(MouseEvent &event A_UNUSED)
{
switch (type)
{
- case ActorSprite::NPC:
+ case ActorType::NPC:
gui->setCursorType(mHoverBeing->getHoverCursor());
break;
- case ActorSprite::MONSTER:
+ case ActorType::MONSTER:
gui->setCursorType(mHoverBeing->getHoverCursor());
break;
- case ActorSprite::PORTAL:
+ case ActorType::PORTAL:
gui->setCursorType(mHoverBeing->getHoverCursor());
break;
- case ActorSprite::AVATAR:
- case ActorSprite::FLOOR_ITEM:
- case ActorSprite::UNKNOWN:
- case ActorSprite::PLAYER:
- case ActorSprite::PET:
+ case ActorType::AVATAR:
+ case ActorType::FLOOR_ITEM:
+ case ActorType::UNKNOWN:
+ case ActorType::PLAYER:
+ case ActorType::PET:
default:
gui->setCursorType(Cursor::CURSOR_POINTER);
break;
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 2e8e27960..130245801 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -347,7 +347,7 @@ void AvatarListBox::mousePressed(MouseEvent &event)
if (ava->getType() == AVATAR_PLAYER)
{
const Being *const being = actorManager->findBeingByName(
- ava->getName(), Being::PLAYER);
+ ava->getName(), ActorType::PLAYER);
if (being)
actorManager->heal(being);
}
@@ -366,8 +366,8 @@ void AvatarListBox::mousePressed(MouseEvent &event)
const Avatar *const avatar = model->getAvatarAt(selected);
if (avatar)
{
- const Being *const being = actorManager
- ->findBeingByName(avatar->getName(), Being::PLAYER);
+ const Being *const being = actorManager->findBeingByName(
+ avatar->getName(), ActorType::PLAYER);
if (being)
viewport->showPopup(being);
else
diff --git a/src/gui/windows/botcheckerwindow.cpp b/src/gui/windows/botcheckerwindow.cpp
index e8dd03f63..b606da8f6 100644
--- a/src/gui/windows/botcheckerwindow.cpp
+++ b/src/gui/windows/botcheckerwindow.cpp
@@ -107,7 +107,7 @@ public:
{
Being *const being = dynamic_cast<Being*>(*i);
- if (being && being->getType() == Being::PLAYER
+ if (being && being->getType() == ActorType::PLAYER
&& being != player_node && being->getName() != "")
{
mPlayers.push_back(being);
@@ -406,7 +406,7 @@ void BotCheckerWindow::reset()
{
Being *const being = dynamic_cast<Being*>(*i);
- if (being && being->getType() == Being::PLAYER
+ if (being && being->getType() == ActorType::PLAYER
&& being != player_node && being->getName() != "")
{
being->resetCounters();
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 72dfd21b6..34b4b5b5a 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -124,7 +124,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
mCreateButton(new Button(this, _("Create"), "create", this)),
// TRANSLATORS: char create dialog button
mCancelButton(new Button(this, _("Cancel"), "cancel", this)),
- mPlayer(new Being(0, ActorSprite::PLAYER, static_cast<uint16_t>(0U),
+ mPlayer(new Being(0, ActorType::PLAYER, static_cast<uint16_t>(0U),
nullptr)),
mPlayerBox(new PlayerBox(this, mPlayer, "charcreate_playerbox.xml",
"charcreate_selectedplayerbox.xml")),
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index e0f4d3c51..d6ad291c6 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -687,7 +687,7 @@ void ChatWindow::doPresent() const
FOR_EACH (ActorSpritesIterator, it, actors)
{
- if ((*it)->getType() == ActorSprite::PLAYER)
+ if ((*it)->getType() == ActorType::PLAYER)
{
if (!response.empty())
response.append(", ");
@@ -1547,7 +1547,7 @@ void ChatWindow::battleChatLog(const std::string &line, Own own,
void ChatWindow::localPetSay(const std::string &nick, const std::string &text)
{
Being *const being = actorManager->findBeingByName(
- nick, ActorSprite::PLAYER);
+ nick, ActorType::PLAYER);
Being *pet = nullptr;
if (being)
{
@@ -1572,7 +1572,7 @@ void ChatWindow::localPetSay(const std::string &nick, const std::string &text)
void ChatWindow::localPetEmote(const std::string &nick, const uint8_t emoteId)
{
Being *const being = actorManager->findBeingByName(
- nick, ActorSprite::PLAYER);
+ nick, ActorType::PLAYER);
if (being)
{
Being *const pet = being->getFirstPet();
@@ -1634,7 +1634,7 @@ void ChatWindow::updateOnline(const std::set<std::string> &onlinePlayers) const
if (actorManager)
{
const Being *const being = actorManager->findBeingByName(
- nick, ActorSprite::PLAYER);
+ nick, ActorType::PLAYER);
if (being)
{
tab->setWhisperTabColors();
diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp
index 0145d551f..199c1d84c 100644
--- a/src/gui/windows/killstats.cpp
+++ b/src/gui/windows/killstats.cpp
@@ -477,7 +477,7 @@ void KillStats::validateJacko()
{
const Being *const dstBeing
= actorManager->findBeingByName(
- "Jack O", Being::MONSTER);
+ "Jack O", ActorType::MONSTER);
if (mIsJackoAlive && !dstBeing)
{
mIsJackoAlive = false;
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index ffaba0c2f..8acbfc5a0 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -288,7 +288,7 @@ void Minimap::draw(Graphics *graphics)
const ActorSprites &actors = actorManager->getAll();
FOR_EACH (ActorSpritesConstIterator, it, actors)
{
- if (!(*it) || (*it)->getType() == ActorSprite::FLOOR_ITEM)
+ if (!(*it) || (*it)->getType() == ActorType::FLOOR_ITEM)
continue;
const Being *const being = static_cast<const Being *const>(*it);
@@ -316,20 +316,20 @@ void Minimap::draw(Graphics *graphics)
{
switch (being->getType())
{
- case ActorSprite::MONSTER:
+ case ActorType::MONSTER:
type = UserPalette::MONSTER;
break;
- case ActorSprite::NPC:
+ case ActorType::NPC:
type = UserPalette::NPC;
break;
- case ActorSprite::AVATAR:
- case ActorSprite::UNKNOWN:
- case ActorSprite::PLAYER:
- case ActorSprite::FLOOR_ITEM:
- case ActorSprite::PORTAL:
- case ActorSprite::PET:
+ case ActorType::AVATAR:
+ case ActorType::UNKNOWN:
+ case ActorType::PLAYER:
+ case ActorType::FLOOR_ITEM:
+ case ActorType::PORTAL:
+ case ActorType::PET:
default:
continue;
}
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index db2800978..e8bc1763e 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -852,7 +852,7 @@ void NpcDialog::showAvatar(const uint16_t avatarId)
if (needShow)
{
delete mAvatarBeing;
- mAvatarBeing = new Being(0, ActorSprite::AVATAR, avatarId, nullptr);
+ mAvatarBeing = new Being(0, ActorType::AVATAR, avatarId, nullptr);
mPlayerBox->setPlayer(mAvatarBeing);
if (!mAvatarBeing->empty())
{
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index edd3efbc7..0afe6f90c 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -291,7 +291,7 @@ void ShopWindow::startTrade()
return;
const Being *const being = actorManager->findBeingByName(
- mTradeNick, Being::PLAYER);
+ mTradeNick, ActorType::PLAYER);
tradeWindow->clear();
if (mTradeMoney)
{
@@ -695,7 +695,7 @@ void ShopWindow::processRequest(const std::string &nick, std::string data,
{
if (!player_node || !mTradeNick.empty() || PlayerInfo::isTrading()
|| !actorManager
- || !actorManager->findBeingByName(nick, Being::PLAYER))
+ || !actorManager->findBeingByName(nick, ActorType::PLAYER))
{
return;
}
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index dbba86562..0ff1d8866 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -564,7 +564,7 @@ public:
}
}
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
avatar->setDamageHp(being->getDamageTaken());
@@ -585,7 +585,7 @@ public:
return;
avatar->setDamageHp(0);
Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
being->setDamageTaken(0);
@@ -1157,7 +1157,7 @@ public:
FOR_EACHP (StringVectCIter, it, players)
{
Avatar *const ava = new Avatar(*it);
- if (actorManager->findBeingByName(*it, Being::PLAYER)
+ if (actorManager->findBeingByName(*it, ActorType::PLAYER)
|| players2.find(*it) != players2.end())
{
ava->setOnline(true);
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 38ddcf806..ff24030d4 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -192,7 +192,7 @@ void WhoIsOnline::handleLink(const std::string& link, MouseEvent *event)
{
const std::string text = decodeLinkText(link);
Being *const being = actorManager->findBeingByName(
- text, Being::PLAYER);
+ text, ActorType::PLAYER);
if (being && viewport)
{
@@ -414,7 +414,7 @@ void WhoIsOnline::loadWebList()
if (actorManager)
{
Being *const being = actorManager->findBeingByName(
- nick, Being::PLAYER);
+ nick, ActorType::PLAYER);
if (being)
{
if (level > 0)
@@ -808,7 +808,7 @@ void OnlinePlayer::setText(std::string color)
if (mStatus != 255 && actorManager)
{
Being *const being = actorManager->findBeingByName(
- mNick, Being::PLAYER);
+ mNick, ActorType::PLAYER);
if (being)
{
being->setState(mStatus);
diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp
index 48485e9b4..1dd4d8247 100644
--- a/src/guildmanager.cpp
+++ b/src/guildmanager.cpp
@@ -408,7 +408,7 @@ bool GuildManager::process(std::string msg)
if (actorManager)
{
Being *const b = actorManager->findBeingByName(
- msg, Being::PLAYER);
+ msg, ActorType::PLAYER);
if (b)
{
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 34beab5ad..c983cfd9d 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -70,33 +70,33 @@ Being *BeingHandler::createBeing(const int id, const int16_t job) const
if (!actorManager)
return nullptr;
- ActorSprite::Type type = ActorSprite::UNKNOWN;
+ ActorType::Type type = ActorType::UNKNOWN;
if (job <= 25 || (job >= 4001 && job <= 4049))
- type = ActorSprite::PLAYER;
+ type = ActorType::PLAYER;
else if (job >= 46 && job <= 1000)
- type = ActorSprite::NPC;
+ type = ActorType::NPC;
else if (job > 1000 && job <= 2000)
- type = ActorSprite::MONSTER;
+ type = ActorType::MONSTER;
else if (job == 45)
- type = ActorSprite::PORTAL;
+ type = ActorType::PORTAL;
Being *const being = actorManager->createBeing(id, type, job);
- if (type == ActorSprite::PLAYER || type == ActorSprite::NPC)
+ if (type == ActorType::PLAYER || type == ActorType::NPC)
{
being->updateFromCache();
requestNameById(id);
if (player_node)
player_node->checkNewName(being);
}
- if (type == Being::PLAYER)
+ if (type == ActorType::PLAYER)
{
if (botCheckerWindow)
botCheckerWindow->updateList();
if (socialWindow)
socialWindow->updateActiveList();
}
- else if (type == Being::NPC)
+ else if (type == ActorType::NPC)
{
if (questsWindow)
questsWindow->addEffect(being);
@@ -141,7 +141,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
Being *dstBeing = actorManager->findBeing(id);
- if (dstBeing && dstBeing->getType() == Being::MONSTER
+ if (dstBeing && dstBeing->getType() == ActorType::MONSTER
&& !dstBeing->isAlive())
{
actorManager->destroy(dstBeing);
@@ -169,7 +169,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
}
else
{
- if (dstBeing->getType() == Being::NPC)
+ if (dstBeing->getType() == ActorType::NPC)
{
actorManager->undelete(dstBeing);
if (serverVersion < 1)
@@ -177,7 +177,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
}
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
if (spawnId)
@@ -198,7 +198,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const int hairStyle = msg.readInt8();
const uint8_t look = msg.readInt8();
dstBeing->setSubtype(job, look);
- if (dstBeing->getType() == ActorSprite::MONSTER && player_node)
+ if (dstBeing->getType() == ActorType::MONSTER && player_node)
player_node->checkNewName(dstBeing);
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
const uint16_t weapon = msg.readInt16();
@@ -215,7 +215,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const uint16_t shoes = msg.readInt16(); // clothes color
uint16_t gloves;
- if (dstBeing->getType() == ActorSprite::MONSTER)
+ if (dstBeing->getType() == ActorType::MONSTER)
{
if (serverVersion > 0)
{
@@ -246,7 +246,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
msg.readInt16(); // manner
dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3
- if (serverVersion > 0 && dstBeing->getType() == ActorSprite::MONSTER)
+ if (serverVersion > 0 && dstBeing->getType() == ActorType::MONSTER)
{
const int attackRange = msg.readInt8(); // karma
dstBeing->setAttackRange(attackRange);
@@ -257,7 +257,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
}
uint8_t gender = msg.readInt8();
- if (!disguiseId && dstBeing->getType() == ActorSprite::PLAYER)
+ if (!disguiseId && dstBeing->getType() == ActorType::PLAYER)
{
// reserving bits for future usage
gender &= 3;
@@ -275,7 +275,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
if (!mHideShield)
setSprite(dstBeing, EA_SPRITE_SHIELD, shield);
}
- else if (dstBeing->getType() == ActorSprite::NPC)
+ else if (dstBeing->getType() == ActorType::NPC)
{
switch (gender)
{
@@ -369,7 +369,7 @@ void BeingHandler::processBeingMove2(Net::MessageIn &msg) const
dstBeing->setAction(BeingAction::STAND, 0);
dstBeing->setTileCoords(srcX, srcY);
dstBeing->setDestination(dstX, dstY);
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
}
@@ -415,7 +415,7 @@ void BeingHandler::processBeingRemove(Net::MessageIn &msg) const
}
else
{
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
{
if (botCheckerWindow)
botCheckerWindow->updateList();
@@ -493,11 +493,11 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
case Being::FLEE: // Lucky Dodge
if (srcBeing)
{
- if (srcSpeed && srcBeing->getType() == Being::PLAYER)
+ if (srcSpeed && srcBeing->getType() == ActorType::PLAYER)
srcBeing->setAttackDelay(srcSpeed);
// attackid=1, type
srcBeing->handleAttack(dstBeing, param1, 1);
- if (srcBeing->getType() == Being::PLAYER)
+ if (srcBeing->getType() == ActorType::PLAYER)
srcBeing->setAttackTime();
}
if (dstBeing)
@@ -517,7 +517,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
if (srcBeing)
{
srcBeing->setAction(BeingAction::SIT, 0);
- if (srcBeing->getType() == Being::PLAYER)
+ if (srcBeing->getType() == ActorType::PLAYER)
{
srcBeing->setMoveTime();
if (player_node)
@@ -530,7 +530,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
if (srcBeing)
{
srcBeing->setAction(BeingAction::STAND, 0);
- if (srcBeing->getType() == Being::PLAYER)
+ if (srcBeing->getType() == ActorType::PLAYER)
{
srcBeing->setMoveTime();
if (player_node)
@@ -568,7 +568,7 @@ void BeingHandler::processBeingSelfEffect(Net::MessageIn &msg) const
effectManager->trigger(effectType, being);
// +++ need dehard code effectType == 3
- if (effectType == 3 && being->getType() == Being::PLAYER
+ if (effectType == 3 && being->getType() == ActorType::PLAYER
&& socialWindow)
{ // reset received damage
socialWindow->resetDamage(being->getName());
@@ -593,7 +593,7 @@ void BeingHandler::processBeingEmotion(Net::MessageIn &msg) const
player_node->imitateEmote(dstBeing, emote);
}
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
}
@@ -617,7 +617,7 @@ void BeingHandler::processNameResponse(Net::MessageIn &msg) const
dstBeing->updateGuild();
dstBeing->addToCache();
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->updateColors();
if (player_node)
diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp
index 4ae292860..cc43de8cd 100644
--- a/src/net/ea/chathandler.cpp
+++ b/src/net/ea/chathandler.cpp
@@ -294,7 +294,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg,
std::string chatMsg = msg.readRawString(chatMsgLength);
- if (being->getType() == Being::PLAYER)
+ if (being->getType() == ActorType::PLAYER)
being->setTalkTime();
const size_t pos = chatMsg.find(" : ", 0);
@@ -309,7 +309,7 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg,
sender_name = "?";
}
else if (sender_name != being->getName()
- && being->getType() == Being::PLAYER)
+ && being->getType() == ActorType::PLAYER)
{
if (!being->getName().empty())
sender_name = being->getName();
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp
index fc1ef8def..18877c686 100644
--- a/src/net/ea/guildhandler.cpp
+++ b/src/net/ea/guildhandler.cpp
@@ -274,7 +274,7 @@ void GuildHandler::processGuildMemberList(Net::MessageIn &msg) const
if (actorManager)
{
Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
being->setGuildName(taGuild->getName());
@@ -476,7 +476,7 @@ void GuildHandler::processGuildLeave(Net::MessageIn &msg) const
if (actorManager)
{
Being *const b = actorManager->findBeingByName(
- nick, Being::PLAYER);
+ nick, ActorType::PLAYER);
if (b)
b->clearGuilds();
@@ -519,7 +519,7 @@ void GuildHandler::processGuildExpulsion(Net::MessageIn &msg) const
if (actorManager)
{
Being *const b = actorManager->findBeingByName(
- nick, Being::PLAYER);
+ nick, ActorType::PLAYER);
if (b)
b->clearGuilds();
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 32b08046e..a6476d4fa 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -222,7 +222,7 @@ void PartyHandler::processPartyInvited(Net::MessageIn &msg) const
const Being *const being = actorManager->findBeing(id);
if (being)
{
- if (being->getType() == Being::PLAYER)
+ if (being->getType() == ActorType::PLAYER)
nick = being->getName();
}
}
@@ -360,7 +360,7 @@ void PartyHandler::processPartyLeave(Net::MessageIn &msg) const
if (actorManager)
{
Being *const b = actorManager->findBeing(id);
- if (b && b->getType() == Being::PLAYER)
+ if (b && b->getType() == ActorType::PLAYER)
{
b->setParty(nullptr);
b->setPartyName("");
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index a6716a661..e07062585 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -286,7 +286,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
// color.clear();
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
if (!player_node)
@@ -401,7 +401,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
dstBeing->updateGuild();
dstBeing->addToCache();
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->updateColors();
if (player_node)
@@ -611,7 +611,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
msg.readInt8(); // unknown
- if (dstBeing->getType() != Being::PLAYER
+ if (dstBeing->getType() != ActorType::PLAYER
|| msgType != 3)
{
dstBeing->setActionTime(tick_time);
@@ -623,7 +623,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setStatusEffectBlock(16, static_cast<uint16_t>(
statusEffects & 0xffffU));
- if (msgType == 3 && dstBeing->getType() == Being::PLAYER)
+ if (msgType == 3 && dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
}
@@ -652,7 +652,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
Being *dstBeing = actorManager->findBeing(id);
- if (dstBeing && dstBeing->getType() == Being::MONSTER
+ if (dstBeing && dstBeing->getType() == ActorType::MONSTER
&& !dstBeing->isAlive())
{
actorManager->destroy(dstBeing);
@@ -681,11 +681,11 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
else
{
// undeleting marked for deletion being
- if (dstBeing->getType() == Being::NPC)
+ if (dstBeing->getType() == ActorType::NPC)
actorManager->undelete(dstBeing);
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
if (spawnId)
@@ -705,7 +705,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
dstBeing->setSubtype(job, 0);
- if (dstBeing->getType() == ActorSprite::MONSTER && player_node)
+ if (dstBeing->getType() == ActorType::MONSTER && player_node)
player_node->checkNewName(dstBeing);
const int hairStyle = msg.readInt16();
@@ -719,7 +719,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
const uint16_t shoes = msg.readInt16(); // clothes color
uint16_t gloves;
- if (dstBeing->getType() == ActorSprite::MONSTER)
+ if (dstBeing->getType() == ActorType::MONSTER)
{
msg.readInt32();
msg.readInt32();
@@ -737,7 +737,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
msg.readInt8(); // karma
uint8_t gender = msg.readInt8();
- if (dstBeing->getType() == ActorSprite::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
{
gender &= 3;
dstBeing->setGender(Being::intToGender(gender));
@@ -753,7 +753,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
if (!mHideShield)
setSprite(dstBeing, SPRITE_SHIELD, shield);
}
- else if (dstBeing->getType() == ActorSprite::NPC)
+ else if (dstBeing->getType() == ActorType::NPC)
{
switch (gender)
{
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index edde95a89..33ff12a57 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -206,7 +206,7 @@ void GuildHandler::invite(const int guildId A_UNUSED,
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut msg(CMSG_GUILD_INVITE);
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp
index 6d39fe85b..b41fd36d1 100644
--- a/src/net/eathena/partyhandler.cpp
+++ b/src/net/eathena/partyhandler.cpp
@@ -125,7 +125,7 @@ void PartyHandler::invite(const std::string &name) const
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut outMsg(CMSG_PARTY_INVITE);
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 314f9ee49..5bd39457a 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -287,7 +287,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
id2 = 1;
}
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->setOtherTime();
if (!player_node)
@@ -410,7 +410,7 @@ void BeingHandler::processNameResponse2(Net::MessageIn &msg)
dstBeing->updateGuild();
dstBeing->addToCache();
- if (dstBeing->getType() == Being::PLAYER)
+ if (dstBeing->getType() == ActorType::PLAYER)
dstBeing->updateColors();
if (player_node)
@@ -636,7 +636,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
msg.readInt8(); // unknown
- if (dstBeing->getType() != Being::PLAYER
+ if (dstBeing->getType() != ActorType::PLAYER
|| msgType != 3)
{
dstBeing->setActionTime(tick_time);
@@ -648,7 +648,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setStatusEffectBlock(16, static_cast<uint16_t>(
statusEffects & 0xffff));
- if (msgType == 3 && dstBeing->getType() == Being::PLAYER)
+ if (msgType == 3 && dstBeing->getType() == ActorType::PLAYER)
dstBeing->setMoveTime();
}
diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp
index 4db171545..af45d63cc 100644
--- a/src/net/tmwa/guildhandler.cpp
+++ b/src/net/tmwa/guildhandler.cpp
@@ -212,7 +212,7 @@ void GuildHandler::invite(const int guildId A_UNUSED,
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut msg(CMSG_GUILD_INVITE);
diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp
index a7088e33b..310d71783 100644
--- a/src/net/tmwa/partyhandler.cpp
+++ b/src/net/tmwa/partyhandler.cpp
@@ -127,7 +127,7 @@ void PartyHandler::invite(const std::string &name) const
return;
const Being *const being = actorManager->findBeingByName(
- name, Being::PLAYER);
+ name, ActorType::PLAYER);
if (being)
{
MessageOut outMsg(CMSG_PARTY_INVITE);
diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp
index 80927c693..8af99db14 100644
--- a/src/spellmanager.cpp
+++ b/src/spellmanager.cpp
@@ -152,7 +152,7 @@ void SpellManager::invoke(const int spellId) const
{
invokeSpell(spell);
}
- if ((target && (target->getType() != Being::MONSTER
+ if ((target && (target->getType() != ActorType::MONSTER
|| spell->getCommandType() == TEXT_COMMAND_TEXT))
&& (spell->getTargetType() == ALLOWTARGET
|| spell->getTargetType() == NEEDTARGET))