diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-29 03:12:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-29 03:12:26 +0300 |
commit | 448ff09baf47387c9cfb6919028b1d4bbe2c8f0b (patch) | |
tree | 35258d1b669dd6fa83d0a4d21792337c6f6c228d /src/being | |
parent | 9993fbc1d1bec556143d974f148869e1fb4c6307 (diff) | |
download | plus-448ff09baf47387c9cfb6919028b1d4bbe2c8f0b.tar.gz plus-448ff09baf47387c9cfb6919028b1d4bbe2c8f0b.tar.bz2 plus-448ff09baf47387c9cfb6919028b1d4bbe2c8f0b.tar.xz plus-448ff09baf47387c9cfb6919028b1d4bbe2c8f0b.zip |
Add some missing tmwa defines.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 22 | ||||
-rw-r--r-- | src/being/being.h | 6 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 2 | ||||
-rw-r--r-- | src/being/localplayer.h | 10 |
4 files changed, 36 insertions, 4 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 285ed8ca0..d762dee24 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -328,8 +328,10 @@ Being::~Being() if (mOwner) { +#ifdef TMWA_SUPPORT if (mType == ActorType::LocalPet) mOwner->unassignPet(this); +#endif mOwner = nullptr; } @@ -441,6 +443,7 @@ void Being::setSubtype(const BeingTypeId subtype, if (mInfo) setupSpriteDisplay(mInfo->getDisplay(), ForceDisplay_false); break; +#ifdef TMWA_SUPPORT case ActorType::LocalPet: mInfo = PETDB::get(fromInt(mId, BeingTypeId)); if (mInfo) @@ -462,6 +465,7 @@ void Being::setSubtype(const BeingTypeId subtype, } } break; +#endif case ActorType::Player: { int id = -100 - toInt(subtype, int); @@ -2553,12 +2557,14 @@ void Being::setSpriteId(const unsigned int slot, int startTime = 0; AnimatedSprite *restrict equipmentSprite = nullptr; +#ifdef TMWA_SUPPORT if (mType == ActorType::Player) { const BeingId pet = fromInt(info.getPet(), BeingId); if (pet != BeingId_zero) addPet(pet); } +#endif if (!filename.empty()) { @@ -2685,12 +2691,14 @@ void Being::setSpriteColor(const unsigned int slot, int startTime = 0; AnimatedSprite *restrict equipmentSprite = nullptr; +#ifdef TMWA_SUPPORT if (mType == ActorType::Player) { const BeingId pet = fromInt(info.getPet(), BeingId); if (pet != BeingId_zero) addPet(pet); } +#endif if (!filename.empty()) { @@ -2781,12 +2789,14 @@ void Being::setSpriteColorId(const unsigned int slot, int startTime = 0; AnimatedSprite *restrict equipmentSprite = nullptr; +#ifdef TMWA_SUPPORT if (mType == ActorType::Player) { const BeingId pet = fromInt(info.getPet(), BeingId); if (pet != BeingId_zero) addPet(pet); } +#endif if (!filename.empty()) { @@ -2879,12 +2889,14 @@ void Being::setSpriteCards(const unsigned int slot, int startTime = 0; AnimatedSprite *restrict equipmentSprite = nullptr; +#ifdef TMWA_SUPPORT if (mType == ActorType::Player) { const BeingId pet = fromInt(info.getPet(), BeingId); if (pet != BeingId_zero) addPet(pet); } +#endif if (!cards.isEmpty()) colorId = ItemColorManager::getColorFromCards(cards); @@ -3618,7 +3630,9 @@ void Being::draw(Graphics *restrict const graphics, break; case ActorType::Npc: case ActorType::FloorItem: +#ifdef TMWA_SUPPORT case ActorType::LocalPet: +#endif case ActorType::Avatar: default: drawOther(graphics, @@ -4412,7 +4426,9 @@ std::string Being::loadComment(const std::string &restrict name, case ActorType::Monster: case ActorType::FloorItem: case ActorType::Portal: +#ifdef TMWA_SUPPORT case ActorType::LocalPet: +#endif case ActorType::Avatar: case ActorType::Mercenary: case ActorType::Homunculus: @@ -4449,7 +4465,9 @@ void Being::saveComment(const std::string &restrict name, case ActorType::Monster: case ActorType::FloorItem: case ActorType::Portal: +#ifdef TMWA_SUPPORT case ActorType::LocalPet: +#endif case ActorType::Avatar: case ActorType::Unknown: case ActorType::Pet: @@ -4655,6 +4673,7 @@ void Being::addEffect(const std::string &restrict name) restrict2 paths.getStringValue("sprites") + name); } +#ifdef TMWA_SUPPORT void Being::addPet(const BeingId id) restrict2 { if (!actorManager || !config.getBoolValue("usepets")) @@ -4679,6 +4698,7 @@ void Being::addPet(const BeingId id) restrict2 being->setTileCoords(dstX, dstY); } } +#endif Being *Being::findChildPet(const BeingId id) restrict2 { @@ -4728,6 +4748,7 @@ void Being::removeAllPets() restrict2 mPets.clear(); } +#ifdef TMWA_SUPPORT void Being::updatePets() restrict2 { removeAllPets(); @@ -4742,6 +4763,7 @@ void Being::updatePets() restrict2 addPet(pet); } } +#endif void Being::unassignPet(const Being *restrict const pet1) restrict2 { diff --git a/src/being/being.h b/src/being/being.h index a224403c7..6b805a3b6 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -889,11 +889,13 @@ class Being notfinal : public ActorSprite, void addEffect(const std::string &restrict name) restrict2; +#ifdef TMWA_SUPPORT void addPet(const BeingId id) restrict2; - void removePet(const BeingId id) restrict2; - void updatePets() restrict2; +#endif + + void removePet(const BeingId id) restrict2; void fixPetSpawnPos(int &restrict dstX, int &restrict dstY) const restrict2; diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 62f30a015..af020d7ea 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -1638,6 +1638,7 @@ void LocalPlayer::specialMove(const unsigned char direction) } } +#ifdef TMWA_SUPPORT void LocalPlayer::magicAttack() const { if (Net::getNetworkType() != ServerType::TMWATHENA) @@ -1693,6 +1694,7 @@ void LocalPlayer::tryMagic(const std::string &spell, const int baseMagic, } } } +#endif void LocalPlayer::loadHomes() { diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 50ef31052..cfbdf4285 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -204,7 +204,9 @@ class LocalPlayer final : public Being, void tryPingRequest(); +#ifdef TMWA_SUPPORT void magicAttack() const; +#endif void specialMove(const unsigned char direction); @@ -441,8 +443,12 @@ class LocalPlayer final : public Being, void changeEquipmentBeforeAttack(const Being *const target) const; - static void tryMagic(const std::string &spell, const int baseMagic, - const int schoolMagic, const int mana); +#ifdef TMWA_SUPPORT + static void tryMagic(const std::string &spell, + const int baseMagic, + const int schoolMagic, + const int mana); +#endif void loadHomes(); |