From 0fa192854595ebe03cce54ad2b251abc4c8e8827 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Jan 2014 23:00:47 +0300 Subject: add support for multiply pets for one player at same time. But one item still can have only one pet. --- src/being/being.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/being/being.h') diff --git a/src/being/being.h b/src/being/being.h index 634c26d23..a93d0e3db 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -877,21 +877,27 @@ class Being : public ActorSprite, public ConfigListener void addPet(const int id); - void removePet(); + void removePet(const int id); void updatePets(); void fixPetSpawnPos(int &dstX, int &dstY) const; - Being *getPet() - { return mPet; } + const std::vector &getPets() const + { return mPets; } - void setPet(Being *const pet) - { mPet = pet; } + Being *getFirstPet() + { return mPets.empty() ? nullptr : mPets[0]; } void setOwner(Being *const owner) { mOwner = owner; } + void unassignPet(Being *const pet); + + void removeAllPets(); + + Being *findChildPet(const int id); + void playSfx(const SoundInfo &sound, Being *const being, const bool main, const int x, const int y) const; @@ -1029,7 +1035,7 @@ class Being : public ActorSprite, public ConfigListener int *mSpriteHide; int *mSpriteDraw; std::string mComment; - Being *mPet; + std::vector mPets; Being *mOwner; Particle *mSpecialParticle; -- cgit v1.2.3-60-g2f50