diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-04 18:41:41 +0000 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-04 18:41:41 +0000 |
commit | c9fba69c164a4760d0db7737866bf7405ad448e9 (patch) | |
tree | 5510f3711474c5f79dc46ebabdf019678011d58e /src/being.cpp | |
parent | 452ebe4c4a0199fd07848a27f176723d3acf5704 (diff) | |
download | mana-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.cpp | 7 |
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; |