summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-05-21 01:12:02 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-05-21 01:12:02 +0200
commitef45deeb0bb4fbc3fe06d7c556f5272205891da7 (patch)
tree3fed07eb593befa8a95ae7a2fa95eab0af4fe965 /src
parent010e0fda51faf69b2b0319e7e1500e13c780fb4d (diff)
downloadmanaserv-ef45deeb0bb4fbc3fe06d7c556f5272205891da7.tar.gz
manaserv-ef45deeb0bb4fbc3fe06d7c556f5272205891da7.tar.xz
manaserv-ef45deeb0bb4fbc3fe06d7c556f5272205891da7.zip
Some cleanup in StatusEffect class
No functional changes.
Diffstat (limited to 'src')
-rw-r--r--src/game-server/statuseffect.cpp24
-rw-r--r--src/game-server/statuseffect.hpp4
2 files changed, 14 insertions, 14 deletions
diff --git a/src/game-server/statuseffect.cpp b/src/game-server/statuseffect.cpp
index 4544bc1..f201927 100644
--- a/src/game-server/statuseffect.cpp
+++ b/src/game-server/statuseffect.cpp
@@ -23,25 +23,25 @@
#include "scripting/script.hpp"
#include "game-server/being.hpp"
-StatusEffect::StatusEffect(int id)
+StatusEffect::StatusEffect(int id):
+ mId(id),
+ mScript(0)
{
- mId = id;
- mScript = NULL;
}
StatusEffect::~StatusEffect()
{
- if (mScript) delete mScript;
+ delete mScript;
}
void StatusEffect::tick(Being *target, int count)
{
- if (mScript)
- {
- mScript->setMap(target->getMap());
- mScript->prepare("tick");
- mScript->push(target);
- mScript->push(count);
- mScript->execute();
- }
+ if (mScript)
+ {
+ mScript->setMap(target->getMap());
+ mScript->prepare("tick");
+ mScript->push(target);
+ mScript->push(count);
+ mScript->execute();
+ }
}
diff --git a/src/game-server/statuseffect.hpp b/src/game-server/statuseffect.hpp
index 23f1059..3aa4d84 100644
--- a/src/game-server/statuseffect.hpp
+++ b/src/game-server/statuseffect.hpp
@@ -27,7 +27,7 @@ class Being;
class StatusEffect
{
public:
- StatusEffect(int);
+ StatusEffect(int id);
~StatusEffect();
void tick(Being *target, int count);
@@ -36,7 +36,7 @@ class StatusEffect
{ return mId; }
void setScript(Script *script)
- { mScript = script; };
+ { mScript = script; }
private:
int mId;