summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-08-04 18:41:41 +0000
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-08-04 18:41:41 +0000
commitc9fba69c164a4760d0db7737866bf7405ad448e9 (patch)
tree5510f3711474c5f79dc46ebabdf019678011d58e /src/being.cpp
parent452ebe4c4a0199fd07848a27f176723d3acf5704 (diff)
downloadmana-c9fba69c164a4760d0db7737866bf7405ad448e9.tar.gz
mana-c9fba69c164a4760d0db7737866bf7405ad448e9.tar.bz2
mana-c9fba69c164a4760d0db7737866bf7405ad448e9.tar.xz
mana-c9fba69c164a4760d0db7737866bf7405ad448e9.zip
Add to npc option targetSelection to allow/disallow npc selection.
The targetSelection attribute is supported on monsters and NPCs. Also changed return value of Being::getInfo to indicate it can't return nullptr. (cherry picked from M+ commit dbc3b324a0c5dcb1a0ee29b289e71423a06e85fd)
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 985faa83..b9a24509 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -127,6 +127,11 @@ void Being::setSubtype(Uint16 subtype)
}
}
+bool Being::isTargetSelection() const
+{
+ return mInfo->isTargetSelection();
+}
+
ActorSprite::TargetCursorSize Being::getTargetCursorSize() const
{
return mInfo->getTargetCursorSize();
@@ -383,7 +388,7 @@ void Being::takeDamage(Being *attacker, int amount,
}
else if (attacker && attacker->getType() == MONSTER)
{
- const Attack &attack = attacker->getInfo()->getAttack(attackId);
+ const Attack &attack = attacker->getInfo().getAttack(attackId);
if (type != CRITICAL)
hitEffectId = attack.mHitEffectId;