From ecd456560bf8dbd12822ccc8a5b71e957ab85df4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Nov 2011 22:15:53 +0300 Subject: Add support compotability with future mana reorder sprites implimentation. (support for missing sprite tag) --- src/being.cpp | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index b344e9709..036f823e6 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -2171,22 +2171,48 @@ void Being::recalcSpritesOrder() { int remSprite = itr->first; const std::map &itemReplacer = itr->second; - if (itemReplacer.empty()) - { - mSpriteHide[remSprite] = 1; + if (remSprite >= 0) + { // slot known + if (itemReplacer.empty()) + { + mSpriteHide[remSprite] = 1; + } + else + { + std::map::const_iterator repIt + = itemReplacer.find(mSpriteIDs[remSprite]); + if (repIt != itemReplacer.end()) + { + mSpriteHide[remSprite] = repIt->second; + if (repIt->second != 1) + { + setSprite(remSprite, repIt->second, + mSpriteColors[remSprite], + 1, false, true); + } + } + } } else - { + { // slot unknown. Search for real slot, this can be slow std::map::const_iterator repIt - = itemReplacer.find(mSpriteIDs[remSprite]); - if (repIt != itemReplacer.end()) + = itemReplacer.begin(); + std::map::const_iterator repIt_end + = itemReplacer.end(); + for (;repIt != repIt_end; ++ repIt) { - mSpriteHide[remSprite] = repIt->second; - if (repIt->second != 1) + for (unsigned slot2 = 0; slot2 < sz; slot2 ++) { - setSprite(remSprite, repIt->second, - mSpriteColors[remSprite], - 1, false, true); + if (mSpriteIDs[slot2] == repIt->first) + { + mSpriteHide[slot2] = repIt->second; + if (repIt->second != 1) + { + setSprite(slot2, repIt->second, + mSpriteColors[slot2], + 1, false, true); + } + } } } } -- cgit v1.2.3-70-g09d2 From aad864d74e74e89e9d8ec11774d115046a3668cb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Nov 2011 23:33:45 +0300 Subject: Fix dead mobs and floor items Y sorting position. --- src/actor.cpp | 3 ++- src/actor.h | 7 +++++++ src/being.cpp | 2 ++ src/flooritem.cpp | 1 + src/map.cpp | 2 +- src/particle.h | 6 ++++++ src/textparticle.h | 4 ++++ 7 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src/being.cpp') diff --git a/src/actor.cpp b/src/actor.cpp index 095f3d959..150f6042b 100644 --- a/src/actor.cpp +++ b/src/actor.cpp @@ -29,7 +29,8 @@ #include "debug.h" Actor::Actor(): - mMap(nullptr) + mMap(nullptr), + mYDiff(0) {} Actor::~Actor() diff --git a/src/actor.h b/src/actor.h index 654141221..9afaff93d 100644 --- a/src/actor.h +++ b/src/actor.h @@ -87,6 +87,12 @@ public: virtual int getPixelY() const { return static_cast(mPos.y); } + /** + * Returns the pixel Y coordinate of the actor for sorting only. + */ + virtual int getSortPixelY() const + { return static_cast(mPos.y) - mYDiff; } + /** * Returns the x coordinate in tiles of the actor. */ @@ -121,6 +127,7 @@ public: protected: Map *mMap; Vector mPos; /**< Position in pixels relative to map. */ + int mYDiff; private: Actors::iterator mMapActor; diff --git a/src/being.cpp b/src/being.cpp index 036f823e6..73675318d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1017,6 +1017,8 @@ void Being::setAction(Action action, int attackType A_UNUSED) currentAction = SpriteAction::DEAD; if (mInfo) sound.playSfx(mInfo->getSound(SOUND_EVENT_DIE), mX, mY); + if (mType == MONSTER) + mYDiff = 31; break; case STAND: currentAction = SpriteAction::STAND; diff --git a/src/flooritem.cpp b/src/flooritem.cpp index fa6cbf618..cf1ee16dc 100644 --- a/src/flooritem.cpp +++ b/src/flooritem.cpp @@ -80,6 +80,7 @@ FloorItem::FloorItem(int id, const ItemInfo &info = ItemDB::get(itemId); setupSpriteDisplay(info.getDisplay(), true, 1, info.getDyeColorsString(mColor)); + mYDiff = 31; } const ItemInfo &FloorItem::getInfo() const diff --git a/src/map.cpp b/src/map.cpp index bcf2b22fe..e706f120b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -85,7 +85,7 @@ class ActorFunctuator { if (!a || !b) return false; - return a->getPixelY() < b->getPixelY(); + return a->getSortPixelY() < b->getSortPixelY(); } } actorCompare; diff --git a/src/particle.h b/src/particle.h index 0a4a2253d..2e3aa8740 100644 --- a/src/particle.h +++ b/src/particle.h @@ -113,6 +113,12 @@ class Particle : public Actor virtual int getPixelY() const { return static_cast(mPos.y) - 16; } + /** + * Necessary for sorting with the other sprites for sorting only. + */ + virtual int getSortPixelY() const + { return static_cast(mPos.y) - 16; } + /** * Creates a blank particle as a child of the current particle * Useful for creating target particles diff --git a/src/textparticle.h b/src/textparticle.h index db9dc1766..b37f25732 100644 --- a/src/textparticle.h +++ b/src/textparticle.h @@ -45,6 +45,10 @@ class TextParticle : public Particle virtual int getPixelY() const { return static_cast(mPos.y + mPos.z); } + // hack to improve text visibility (for sorting only) + virtual int getSortPixelY() const + { return static_cast(mPos.y + mPos.z); } + private: std::string mText; /**< Text of the particle. */ gcn::Font *mTextFont; /**< Font used for drawing the text. */ -- cgit v1.2.3-70-g09d2 From bcf7e61d6dd87164d79a211cbda1378e1ddc77bd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 14 Nov 2011 21:21:57 +0300 Subject: Fix code style. --- src/being.cpp | 2 +- src/gui/equipmentwindow.cpp | 9 +++------ src/particlecontainer.h | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 73675318d..9d731d2c9 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -2201,7 +2201,7 @@ void Being::recalcSpritesOrder() = itemReplacer.begin(); std::map::const_iterator repIt_end = itemReplacer.end(); - for (;repIt != repIt_end; ++ repIt) + for (; repIt != repIt_end; ++ repIt) { for (unsigned slot2 = 0; slot2 < sz; slot2 ++) { diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index fbd92f931..cb3ace0c7 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -187,13 +187,10 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) } } } - else + else if (box->image) { - if (box->image) - { - g->drawImage(box->image, box->x + BOX_X_PAD, - box->y + BOX_Y_PAD); - } + g->drawImage(box->image, box->x + BOX_X_PAD, + box->y + BOX_Y_PAD); } } } diff --git a/src/particlecontainer.h b/src/particlecontainer.h index 937c4dd63..2219bd67c 100644 --- a/src/particlecontainer.h +++ b/src/particlecontainer.h @@ -45,7 +45,7 @@ public: * delParent means that the destructor should also free the parent. */ ParticleContainer(ParticleContainer *parent = nullptr, - bool delParent = true); + bool delParent = true); virtual ~ParticleContainer(); -- cgit v1.2.3-70-g09d2 From 8e5861c3cfd41574351547a1a518efcf9007666a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 Nov 2011 04:40:34 +0300 Subject: Add ability to play different animation depend on monster hp. Disabled for legacy servers because monster hp unknown and compilated hp can be wrong (version <= 0). For usage need add to action tag attribute hp="xx" Example: ... Here 50 mean 50% of health or less. Default action tag mean hp=100 --- src/animatedsprite.cpp | 23 +++++++++++-- src/animatedsprite.h | 4 +++ src/being.cpp | 27 +++++++++++++++- src/being.h | 3 ++ src/compoundsprite.cpp | 15 +++++++++ src/compoundsprite.h | 2 ++ src/imagesprite.h | 3 ++ src/net/ea/beinghandler.cpp | 2 +- src/resources/action.cpp | 3 +- src/resources/action.h | 7 ++++ src/resources/spritedef.cpp | 78 +++++++++++++++++++++++++++++++++++---------- src/resources/spritedef.h | 12 +++++-- src/sprite.h | 2 ++ 13 files changed, 157 insertions(+), 24 deletions(-) (limited to 'src/being.cpp') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index c1f1cac85..4143cb47a 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -42,7 +42,9 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite): mSprite(sprite), mAction(nullptr), mAnimation(nullptr), - mFrame(nullptr) + mFrame(nullptr), + mNumber(100), + mNumber1(100) { mAlpha = 1.0f; @@ -51,6 +53,7 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite): mSprite->incRef(); // Play the stand animation by default + //+++ need get num? play(SpriteAction::STAND); } @@ -90,7 +93,7 @@ bool AnimatedSprite::play(std::string spriteAction) if (!mSprite) return false; - Action *action = mSprite->getAction(spriteAction); + Action *action = mSprite->getAction(spriteAction, mNumber); if (!action) return false; @@ -313,3 +316,19 @@ void *AnimatedSprite::getHash() // return mAnimation; return this; } + +bool AnimatedSprite::updateNumber(unsigned num) +{ + if (mNumber1 != num) + { + mNumber1 = num; + mNumber = mSprite->findNumber(num); + if (!mNumber) + { + mNumber = 100; + return false; + } + return true; + } + return false; +} diff --git a/src/animatedsprite.h b/src/animatedsprite.h index 2a2cfb8d8..16bcdf2da 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -84,6 +84,8 @@ class AnimatedSprite : public Sprite virtual void *getHash(); + bool updateNumber(unsigned num); + private: bool updateCurrentAnimation(unsigned int dt); @@ -97,6 +99,8 @@ class AnimatedSprite : public Sprite Action *mAction; /**< The currently active action. */ Animation *mAnimation; /**< The currently active animation. */ Frame *mFrame; /**< The currently active frame. */ + unsigned mNumber; + unsigned mNumber1; }; #endif diff --git a/src/being.cpp b/src/being.cpp index 9d731d2c9..3ed7ba587 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -253,7 +253,8 @@ Being::Being(int id, Type type, Uint16 subtype, Map *map): mAdvanced(false), mShop(false), mAway(false), - mInactive(false) + mInactive(false), + mNumber(100) { mSpriteRemap = new int[20]; mSpriteHide = new int[20]; @@ -287,6 +288,7 @@ Being::Being(int id, Type type, Uint16 subtype, Map *map): updateColors(); resetCounters(); + updatePercentHP(); } Being::~Being() @@ -660,7 +662,10 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) } if (mType == MONSTER) + { + updatePercentHP(); updateName(); + } else if (mType == PLAYER && socialWindow && getName() != "") socialWindow->updateAvatar(getName()); @@ -1036,6 +1041,7 @@ void Being::setAction(Action action, int attackType A_UNUSED) if (currentAction != SpriteAction::INVALID) { + //set mNumber play(currentAction); mAction = action; } @@ -2102,6 +2108,8 @@ void Being::setHP(int hp) mHP = hp; if (mMaxHP < mHP) mMaxHP = mHP; + if (mType == MONSTER) + updatePercentHP(); } void Being::setMaxHP(int hp) @@ -2521,6 +2529,23 @@ void Being::setEmote(Uint8 emotion, int emote_time) } } +void Being::updatePercentHP() +{ + if (!mMaxHP || !serverVersion) + return; + unsigned num = 0; + if (mHP) + { + num = mHP * 100 / mMaxHP; + if (num != mNumber) + { + mNumber = num; + if (updateNumber(mNumber)) + setAction(mAction); + } + } +} + BeingEquipBackend::BeingEquipBackend(Being *being): mBeing(being) { diff --git a/src/being.h b/src/being.h index 9ee60fcdf..1a5644929 100644 --- a/src/being.h +++ b/src/being.h @@ -767,6 +767,8 @@ class Being : public ActorSprite, public ConfigListener void attack2(Being *target = nullptr, bool keep = false, bool dontChangeEquipment = false); + void updatePercentHP(); + protected: /** * Sets the new path for this being. @@ -909,6 +911,7 @@ class Being : public ActorSprite, public ConfigListener bool mShop; bool mAway; bool mInactive; + unsigned mNumber; }; extern std::list beingInfoCache; diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index 3ee988cec..912c51404 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -544,6 +544,21 @@ void CompoundSprite::initCurrentCacheItem() const } } +bool CompoundSprite::updateNumber(unsigned num) +{ + SpriteConstIterator it, it_end; + bool res(false); + for (it = begin(), it_end = end(); it != it_end; ++ it) + { + if (*it) + { + if ((*it)->updateNumber(num)) + res = true; + } + } + return res; +} + CompoundItem::CompoundItem() : // alpha(1.0f), image(nullptr), diff --git a/src/compoundsprite.h b/src/compoundsprite.h index d1b019057..f29bece7f 100644 --- a/src/compoundsprite.h +++ b/src/compoundsprite.h @@ -119,6 +119,8 @@ public: virtual void setAlpha(float alpha); + bool updateNumber(unsigned num); + private: void redraw() const; diff --git a/src/imagesprite.h b/src/imagesprite.h index 21705c812..c59dd8eec 100644 --- a/src/imagesprite.h +++ b/src/imagesprite.h @@ -73,6 +73,9 @@ public: unsigned int getFrameCount() const { return 1; } + bool updateNumber(unsigned num A_UNUSED) + { return false; } + private: Image *mImage; }; diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 5c3c694b3..1c2983137 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -215,10 +215,10 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg, bool visible) int maxHP = msg.readInt32(); if (hp && maxHP) { + dstBeing->setMaxHP(maxHP); int oldHP = dstBeing->getHP(); if (!oldHP || oldHP > hp) dstBeing->setHP(hp); - dstBeing->setMaxHP(maxHP); } } else diff --git a/src/resources/action.cpp b/src/resources/action.cpp index c2af3ff9b..f940bffcb 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -29,7 +29,8 @@ #include "debug.h" -Action::Action() +Action::Action() : + mNumber(100) { } diff --git a/src/resources/action.h b/src/resources/action.h index 05b326d8f..9ab6f98d5 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -43,10 +43,17 @@ class Action Animation *getAnimation(int direction) const; + unsigned getNumber() + { return mNumber; } + + void setNumber(unsigned n) + { mNumber = n; } + protected: typedef std::map Animations; typedef Animations::iterator AnimationIterator; Animations mAnimations; + unsigned mNumber; }; #endif diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 3e2aac785..6b856c5d3 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -41,17 +41,41 @@ SpriteReference *SpriteReference::Empty = nullptr; -Action *SpriteDef::getAction(std::string action) const +Action *SpriteDef::getAction(std::string action, unsigned num) const { - Actions::const_iterator i = mActions.find(action); + Actions::const_iterator i = mActions.find(num); + if (i == mActions.end() && num != 100) + i = mActions.find(100); if (i == mActions.end()) + return nullptr; + + std::map::const_iterator it + = ((*i).second)->find(action); + + if (it == ((*i).second)->end()) { logger->log("Warning: no action \"%s\" defined!", action.c_str()); return nullptr; } - return i->second; + return (*it).second; +} + +unsigned SpriteDef::findNumber(unsigned num) const +{ + unsigned min = 101; + Actions::const_iterator it = mActions.begin(); + Actions::const_iterator it_end = mActions.end(); + for (; it != it_end; ++ it) + { + unsigned n = (*it).first; + if (n >= num && n < min) + min = n; + } + if (min == 101) + return 0; + return min; } SpriteDef *SpriteDef::load(const std::string &animationFile, int variant) @@ -84,11 +108,17 @@ SpriteDef *SpriteDef::load(const std::string &animationFile, int variant) void SpriteDef::substituteAction(std::string complete, std::string with) { - if (mActions.find(complete) == mActions.end()) + Actions::const_iterator it = mActions.begin(); + Actions::const_iterator it_end = mActions.end(); + for (; it != it_end; ++ it) { - Actions::const_iterator i = mActions.find(with); - if (i != mActions.end()) - mActions[complete] = i->second; + std::map *d = (*it).second; + if (d->find(complete) == d->end()) + { + std::map::iterator i = d->find(with); + if (i != d->end()) + (*d)[complete] = i->second; + } } } @@ -162,6 +192,7 @@ void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) { const std::string actionName = XML::getProperty(node, "name", ""); const std::string imageSetName = XML::getProperty(node, "imageset", ""); + const unsigned hp = XML::getProperty(node, "hp", 100); ImageSetIterator si = mImageSets.find(imageSetName); if (si == mImageSets.end()) @@ -179,15 +210,17 @@ void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) return; } Action *action = new Action; - mActions[actionName] = action; + action->setNumber(hp); + addAction(hp, actionName, action); // dirty hack to fix bad resources in tmw server if (actionName == "attack_stab") - mActions["attack"] = action; + addAction(hp, "attack", action); // When first action set it as default direction - if (mActions.size() == 1) - mActions[SpriteAction::DEFAULT] = action; + Actions::const_iterator i = mActions.find(hp); + if ((*i).second->size() == 1) + addAction(hp, SpriteAction::DEFAULT, action); // Load animations for_each_xml_child_node(animationNode, node) @@ -339,14 +372,18 @@ void SpriteDef::includeSprite(xmlNodePtr includeNode) SpriteDef::~SpriteDef() { // Actions are shared, so ensure they are deleted only once. - std::set< Action * > actions; - for (Actions::const_iterator i = mActions.begin(), + std::set actions; + for (Actions::iterator i = mActions.begin(), i_end = mActions.end(); i != i_end; ++i) { - actions.insert(i->second); + std::map::iterator it = (*i).second->begin(); + std::map::iterator it_end = (*i).second->end(); + for (; it != it_end; ++ it) + actions.insert(it->second); + delete (*i).second; } - for (std::set< Action * >::const_iterator i = actions.begin(), + for (std::set::const_iterator i = actions.begin(), i_end = actions.end(); i != i_end; ++i) { delete *i; @@ -355,7 +392,7 @@ SpriteDef::~SpriteDef() mActions.clear(); for (ImageSetIterator i = mImageSets.begin(); - i != mImageSets.end(); ++i) + i != mImageSets.end(); ++i) { if (i->second) { @@ -388,3 +425,12 @@ SpriteDirection SpriteDef::makeSpriteDirection(const std::string &direction) else return DIRECTION_INVALID; } + +void SpriteDef::addAction(unsigned hp, std::string name, Action *action) +{ + Actions::const_iterator i = mActions.find(hp); + if (i == mActions.end()) + mActions[hp] = new std::map(); + + (*mActions[hp])[name] = action; +} diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index b2939fca1..642962c0b 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -117,7 +117,9 @@ class SpriteDef : public Resource /** * Returns the specified action. */ - Action *getAction(std::string action) const; + Action *getAction(std::string action, unsigned num) const; + + unsigned findNumber(unsigned num) const; /** * Converts a string into a SpriteDirection enum. @@ -125,11 +127,14 @@ class SpriteDef : public Resource static SpriteDirection makeSpriteDirection(const std::string &direction); + void addAction(unsigned hp, std::string name, Action *action); + private: /** * Constructor. */ - SpriteDef() {} + SpriteDef() + { } /** * Destructor. @@ -178,7 +183,8 @@ class SpriteDef : public Resource typedef std::map ImageSets; typedef ImageSets::iterator ImageSetIterator; - typedef std::map Actions; +// typedef std::map*> Actions; + typedef std::map*> Actions; ImageSets mImageSets; Actions mActions; diff --git a/src/sprite.h b/src/sprite.h index 52752619b..64721b740 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -112,6 +112,8 @@ class Sprite virtual void *getHash2() { return this; } + virtual bool updateNumber(unsigned num) = 0; + protected: float mAlpha; /**< The alpha opacity used to draw */ }; -- cgit v1.2.3-70-g09d2 From f8cd17e234018066b03b995e92a09981d3d927f8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 24 Nov 2011 04:08:24 +0300 Subject: Remove some debug messages and old comments. --- src/animatedsprite.cpp | 1 - src/being.cpp | 7 ------- src/localplayer.cpp | 12 ------------ src/resources/spritedef.h | 1 - 4 files changed, 21 deletions(-) (limited to 'src/being.cpp') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index 4143cb47a..5277ddf33 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -53,7 +53,6 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite): mSprite->incRef(); // Play the stand animation by default - //+++ need get num? play(SpriteAction::STAND); } diff --git a/src/being.cpp b/src/being.cpp index 3ed7ba587..736d64f1a 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -904,9 +904,6 @@ void Being::setGuild(Guild *guild) if (old) old->removeMember(mName); -// if (guild) -// guild->addMember(mId, mName); - updateColors(); if (this == player_node && socialWindow) @@ -1041,7 +1038,6 @@ void Being::setAction(Action action, int attackType A_UNUSED) if (currentAction != SpriteAction::INVALID) { - //set mNumber play(currentAction); mAction = action; } @@ -2141,7 +2137,6 @@ void Being::recalcSpritesOrder() std::vector slotRemap; std::map itemSlotRemap; -// logger->log("preparation start"); std::vector::iterator it; int oldHide[20]; int dir = mSpriteDirection; @@ -2495,7 +2490,6 @@ void Being::saveComment(const std::string &name, return; } dir += stringToHexPath(name); -// logger->log("save to: %s", dir.c_str()); ResourceManager *resman = ResourceManager::getInstance(); resman->saveTextFile(dir, "comment.txt", name + "\n" + comment); } @@ -2520,7 +2514,6 @@ void Being::setEmote(Uint8 emotion, int emote_time) updateName(); addToCache(); } -// logger->log("flags: %d", emotion - FLAG_SPECIAL); } else { diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 51f1f244e..cbf75a5f9 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -190,7 +190,6 @@ LocalPlayer::LocalPlayer(int id, int subtype): PlayerInfo::setStatMod(WALK_SPEED, 0); loadHomes(); -// initTargetCursor(); config.addListener("showownname", this); config.addListener("targetDeadPlayers", this); @@ -278,16 +277,12 @@ void LocalPlayer::logic() { if (mMessageTime == 0) { - //const Vector &pos = getPosition(); - MessagePair info = mMessages.front(); if (particleEngine) { particleEngine->addTextRiseFadeOutEffect( info.first, - /*(int) pos.x, - (int) pos.y - 48,*/ getPixelX(), getPixelY() - 48, &userPalette->getColor(info.second), @@ -818,8 +813,6 @@ void LocalPlayer::nextTile(unsigned char dir A_UNUSED = 0) if (Net::getNetworkType() != ServerInfo::MANASERV) #endif { -// updatePos(); - if (Party::getParty(1)) { PartyMember *pm = Party::getParty(1)->getMember(getName()); @@ -973,7 +966,6 @@ bool LocalPlayer::pickUp(FloorItem *item) mPickUpTarget = item; mPickUpTarget->addActorSpriteListener(this); -// stopAttack(); } } return true; @@ -3042,10 +3034,7 @@ bool LocalPlayer::pickUpItems(int pickUpType) } item = actorSpriteManager->findItem(x, y); if (item) - { status = pickUp(item); -// status = true; - } break; case 2: switch (mDirection) @@ -3641,7 +3630,6 @@ void LocalPlayer::updateCoords() tmpLayer->clean(); tmpLayer->addRoad(mNavigatePath); } -// navigateTo(mNavigateX, mNavigateY); } } } diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 642962c0b..9b60ae2ff 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -183,7 +183,6 @@ class SpriteDef : public Resource typedef std::map ImageSets; typedef ImageSets::iterator ImageSetIterator; -// typedef std::map*> Actions; typedef std::map*> Actions; ImageSets mImageSets; -- cgit v1.2.3-70-g09d2