summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--data/help/commands.txt2
-rw-r--r--src/gui/popupmenu.cpp1
-rw-r--r--src/particlecontainer.cpp50
-rw-r--r--src/statuseffect.cpp37
-rw-r--r--src/statuseffect.h22
6 files changed, 52 insertions, 62 deletions
diff --git a/NEWS b/NEWS
index 52dbf700..1532c01b 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@
- Added --data parameter for developers
- Added particle effect for critical hits
- Added support for dynamic skill names and hair colors
+- Added support for status effects
- Added ability to add equipment to the shortcut bar
- Added ability to change configuration during login phase (from Aethyra)
- Mouse cursor will now hide when not used for some time
@@ -20,6 +21,7 @@
- Fixed shortcuts being activated when trade window was visible
- Fixed a crash when equipment window is open
- Fixed money value on failing to buy (from Aethyra)
+- Fixed crash in right-click menu when used after a being disappeared
0.0.26 (29 August 2008)
- Added support for a newer version of eAthena server
diff --git a/data/help/commands.txt b/data/help/commands.txt
index e98cb677..2c6e8299 100644
--- a/data/help/commands.txt
+++ b/data/help/commands.txt
@@ -27,7 +27,7 @@
##2Alt + T##P toggle ignore of incoming trades
##2A##P target nearest monster
##2H##P hide all non-sticky windows
- ##2G or Z##P pick up item
+ ##2Z##P pick up item
##2Enter##P focus chat window / send message
##2Shift##P hold it when attacking to lock target for auto
attack
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 23e3bc1e..07719d2c 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -261,7 +261,6 @@ void PopupMenu::handleLink(const std::string& link)
setVisible(false);
- being = NULL;
mBeingId = 0;
mFloorItem = NULL;
mItem = NULL;
diff --git a/src/particlecontainer.cpp b/src/particlecontainer.cpp
index f7672eac..54a7b315 100644
--- a/src/particlecontainer.cpp
+++ b/src/particlecontainer.cpp
@@ -24,10 +24,10 @@
#include "particlecontainer.h"
-ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent) :
+ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent):
mDelParent(delParent),
mNext(parent)
-{};
+{}
ParticleContainer::~ParticleContainer()
{
@@ -36,8 +36,7 @@ ParticleContainer::~ParticleContainer()
delete mNext;
}
-void
-ParticleContainer::clear()
+void ParticleContainer::clear()
{
clearLocally();
if (mNext)
@@ -45,8 +44,7 @@ ParticleContainer::clear()
}
-void
-ParticleContainer::setPositions(float x, float y)
+void ParticleContainer::setPositions(float x, float y)
{
if (mNext)
mNext->setPositions(x, y);
@@ -55,12 +53,12 @@ ParticleContainer::setPositions(float x, float y)
// -- particle list ----------------------------------------
ParticleList::ParticleList(ParticleContainer *parent, bool delParent) :
- ParticleContainer(parent, delParent) {};
+ ParticleContainer(parent, delParent)
+{}
ParticleList::~ParticleList() {}
-void
-ParticleList::addLocally(Particle *particle)
+void ParticleList::addLocally(Particle *particle)
{
if (particle)
{
@@ -70,8 +68,7 @@ ParticleList::addLocally(Particle *particle)
}
}
-void
-ParticleList::removeLocally(Particle *particle)
+void ParticleList::removeLocally(Particle *particle)
{
for (std::list<Particle *>::iterator it = mElements.begin();
it != mElements.end(); it++)
@@ -81,18 +78,16 @@ ParticleList::removeLocally(Particle *particle)
}
}
-void
-ParticleList::clearLocally()
+void ParticleList::clearLocally()
{
for (std::list<Particle *>::iterator it = mElements.begin();
it != mElements.end(); it++)
(*it)->kill();
-
+
mElements.clear();
}
-void
-ParticleList::setPositions(float x, float y)
+void ParticleList::setPositions(float x, float y)
{
ParticleContainer::setPositions(x, y);
@@ -115,13 +110,14 @@ ParticleList::setPositions(float x, float y)
// -- particle vector ----------------------------------------
-ParticleVector::ParticleVector(ParticleContainer *parent, bool delParent) :
- ParticleContainer(parent, delParent) {};
+ParticleVector::ParticleVector(ParticleContainer *parent, bool delParent):
+ ParticleContainer(parent, delParent)
+{}
-ParticleVector::~ParticleVector() {};
+ParticleVector::~ParticleVector()
+{}
-void
-ParticleVector::setLocally(int index, Particle *particle)
+void ParticleVector::setLocally(int index, Particle *particle)
{
assert(index >= 0);
@@ -134,8 +130,7 @@ ParticleVector::setLocally(int index, Particle *particle)
mIndexedElements[index] = particle;
}
-void
-ParticleVector::delLocally(int index)
+void ParticleVector::delLocally(int index)
{
assert(index >= 0);
@@ -150,20 +145,18 @@ ParticleVector::delLocally(int index)
}
}
-void
-ParticleVector::clearLocally()
+void ParticleVector::clearLocally()
{
for (unsigned int i = 0; i < mIndexedElements.size(); i++)
delLocally(i);
}
-void
-ParticleVector::setPositions(float x, float y)
+void ParticleVector::setPositions(float x, float y)
{
ParticleContainer::setPositions(x, y);
for (std::vector<Particle *>::iterator it = mIndexedElements.begin();
- it != mIndexedElements.end(); it++)
+ it != mIndexedElements.end(); it++) {
if (*it)
{
(*it)->setPosition(x, y);
@@ -174,5 +167,6 @@ ParticleVector::setPositions(float x, float y)
*it = NULL;
}
}
+ }
}
diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp
index 564d26f0..eeae45d8 100644
--- a/src/statuseffect.cpp
+++ b/src/statuseffect.cpp
@@ -30,25 +30,25 @@
#define STATUS_EFFECTS_FILE "status-effects.xml"
-StatusEffect::StatusEffect() {};
-StatusEffect::~StatusEffect() {};
+StatusEffect::StatusEffect()
+{}
-void
-StatusEffect::playSFX()
+StatusEffect::~StatusEffect()
+{}
+
+void StatusEffect::playSFX()
{
if (mSFXEffect != "")
sound.playSfx(mSFXEffect);
}
-void
-StatusEffect::deliverMessage()
+void StatusEffect::deliverMessage()
{
if (mMessage != "")
chatWindow->chatLog(mMessage, BY_SERVER);
}
-Particle *
-StatusEffect::getParticle()
+Particle *StatusEffect::getParticle()
{
if (mParticleEffect == "")
return NULL;
@@ -56,13 +56,13 @@ StatusEffect::getParticle()
return particleEngine->addEffect(mParticleEffect, 0, 0);
}
-AnimatedSprite *
-StatusEffect::getIcon()
+AnimatedSprite *StatusEffect::getIcon()
{
if (mIcon == "")
return NULL;
else {
- AnimatedSprite * sprite = AnimatedSprite::load("graphics/sprites/" + mIcon);
+ AnimatedSprite *sprite = AnimatedSprite::load(
+ "graphics/sprites/" + mIcon);
if (false && sprite) {
sprite->play(ACTION_DEFAULT);
sprite->reset();
@@ -71,8 +71,7 @@ StatusEffect::getIcon()
}
}
-SpriteAction
-StatusEffect::getAction()
+SpriteAction StatusEffect::getAction()
{
if (mAction == "")
return ACTION_INVALID;
@@ -90,23 +89,20 @@ static status_effect_map statusEffects;
static status_effect_map stunEffects;
static std::map<int, int> blockEffectIndexMap;
-int
-StatusEffect::blockEffectIndexToEffectIndex(int blockIndex)
+int StatusEffect::blockEffectIndexToEffectIndex(int blockIndex)
{
if (blockEffectIndexMap.find(blockIndex) == blockEffectIndexMap.end())
return -1;
return blockEffectIndexMap[blockIndex];
}
-StatusEffect *
-StatusEffect::getStatusEffect(int index, bool enabling)
+StatusEffect *StatusEffect::getStatusEffect(int index, bool enabling)
{
load();
return statusEffects[enabling][index];
}
-StatusEffect *
-StatusEffect::getStunEffect(int index, bool enabling)
+StatusEffect *StatusEffect::getStunEffect(int index, bool enabling)
{
load();
return stunEffects[enabling][index];
@@ -116,8 +112,7 @@ static bool status_effects_loaded = false;
-void
-StatusEffect::load()
+void StatusEffect::load()
{
if (status_effects_loaded)
return;
diff --git a/src/statuseffect.h b/src/statuseffect.h
index 9db90687..5d18ac92 100644
--- a/src/statuseffect.h
+++ b/src/statuseffect.h
@@ -18,6 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
#ifndef STATUS_EFFECT_H
#define STATUS_EFFECT_H
@@ -33,36 +34,35 @@ public:
~StatusEffect();
/**
- * Plays the sound effect associated with this status effect, if possible
+ * Plays the sound effect associated with this status effect, if possible.
*/
void playSFX();
/**
- * Delivers the chat message associated with this status effect, if possible
+ * Delivers the chat message associated with this status effect, if
+ * possible.
*/
void deliverMessage();
/**
- * Creates the particle effect associated with this status effect, if possible
+ * Creates the particle effect associated with this status effect, if
+ * possible.
*/
- Particle *
- getParticle();
+ Particle *getParticle();
/**
* Retrieves the status icon for this effect, if applicable
*/
- AnimatedSprite *
- getIcon();
+ AnimatedSprite *getIcon();
/**
* Retrieves an action to perform, or ACTION_INVALID
*/
- SpriteAction
- getAction();
+ SpriteAction getAction();
/**
- * Retrieves a status effect.
+ * Retrieves a status effect.
*
* \param index Index of the status effect.
* \param enabling Whether to retrieve the activating effect (true) or
@@ -71,7 +71,7 @@ public:
static StatusEffect *getStatusEffect(int index, bool enabling);
/**
- * Retrieves a stun effect.
+ * Retrieves a stun effect.
*
* \param index Index of the stun effect.
* \param enabling Whether to retrieve the activating effect (true) or