From 2aa9b09d4dfa139941c5a0e1e72acd11f9f4fca2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 Aug 2016 01:53:38 +0300 Subject: Remove some more local pet related code. --- src/being/being.cpp | 31 ------------------------------- src/being/being.h | 9 --------- 2 files changed, 40 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index f82fc4dfe..6cb9f8366 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -207,7 +207,6 @@ Being::Being(const BeingId id, mComment(), mBuyBoard(), mSellBoard(), - mPets(), mOwner(nullptr), mSpecialParticle(nullptr), mChat(nullptr), @@ -339,18 +338,6 @@ Being::~Being() delete2(mChat); removeHorse(); - FOR_EACH (std::vector::iterator, it, mPets) - { - Being *pet = *it; - if (pet) - { - pet->setOwner(nullptr); - actorManager->erase(pet); - delete pet; - } - } - mPets.clear(); - removeAllItemsParticles(); mSpiritParticles.clear(); } @@ -1904,13 +1891,6 @@ void Being::logic() restrict2 actorManager->destroy(this); } - FOR_EACH (std::vector::iterator, it, mPets) - { - Being *const pet = *it; - if (pet) - pet->petLogic(); - } - const SoundInfo *restrict const sound = mNextSound.sound; if (sound) { @@ -4643,17 +4623,6 @@ void Being::addEffect(const std::string &restrict name) restrict2 paths.getStringValue("sprites") + name); } -Being *Being::findChildPet(const BeingId id) restrict2 -{ - FOR_EACH (std::vector::iterator, it, mPets) - { - Being *restrict const pet = *it; - if (pet && pet->mId == id) - return pet; - } - return nullptr; -} - void Being::fixPetSpawnPos(int &restrict dstX, int &restrict dstY) const { diff --git a/src/being/being.h b/src/being/being.h index 7a52df675..1f34d6f9b 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -895,20 +895,12 @@ class Being notfinal : public ActorSprite, void fixPetSpawnPos(int &restrict dstX, int &restrict dstY) const restrict2; - const std::vector &getPets() const restrict2 noexcept2 - { return mPets; } - - Being *getFirstPet() restrict2 - { return mPets.empty() ? nullptr : mPets[0]; } - void setOwner(Being *restrict const owner) restrict2 noexcept2 { mOwner = owner; } Being *getOwner() const restrict2 noexcept2 { return mOwner; } - Being *findChildPet(const BeingId id) restrict2; - void playSfx(const SoundInfo &sound, Being *restrict const being, const bool main, @@ -1231,7 +1223,6 @@ class Being notfinal : public ActorSprite, std::string mComment; std::string mBuyBoard; std::string mSellBoard; - std::vector mPets; Being *restrict mOwner; Particle *restrict mSpecialParticle; ChatObject *restrict mChat; -- cgit v1.2.3-70-g09d2