summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/being.h1
-rw-r--r--src/beingmanager.cpp4
-rw-r--r--src/localplayer.cpp11
-rw-r--r--src/monster.cpp4
-rw-r--r--src/net/playerhandler.cpp1
-rw-r--r--src/player.cpp11
7 files changed, 12 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 92b35668..b5364be0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,9 @@
to tile centers for now).
* src/net/beinghandler.cpp, src/net/beinghandler.h: Added support for
leaving beings.
+ * src/localplayer.cpp, src/beingmanager.cpp, src/player.cpp,
+ src/monster.cpp, src/net/playerhandler.cpp, src/being.h: Removed
+ Being::mFrame field.
2006-08-26 Bjørn Lindeijer <bjorn@lindeijer.nl>
diff --git a/src/being.h b/src/being.h
index 7e5645ae..38c62dbb 100644
--- a/src/being.h
+++ b/src/being.h
@@ -103,7 +103,6 @@ class Being : public Sprite
Uint16 mX, mY; /**< Pixel coordinates (tile center) */
Uint8 mDirection; /**< Facing direction */
Uint8 mAction; /**< Action the being is performing */
- Uint8 mFrame;
Uint16 mWalkTime;
Uint8 mEmotion; /**< Currently showing emotion */
Uint8 mEmotionTime; /**< Time until emotion disappears */
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index 74709fdf..0156ce33 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -127,12 +127,12 @@ void BeingManager::logic()
being->logic();
- if (being->mAction == Being::MONSTER_DEAD && being->mFrame >= 20)
+ /*if (being->mAction == Being::MONSTER_DEAD && being->mFrame >= 20)
{
delete being;
i = mBeings.erase(i);
}
- else {
+ else*/ {
i++;
}
}
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 72e2a369..74924b1d 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -54,20 +54,15 @@ void LocalPlayer::logic()
{
switch (mAction) {
case WALK:
- mFrame = (get_elapsed_time(mWalkTime) * 6) / mWalkSpeed;
- if (mFrame >= 6) {
+ if (get_elapsed_time(mWalkTime) >= mWalkSpeed)
+ {
nextStep();
}
break;
case ATTACK:
- int frames = 4;
- if (getWeapon() == 2)
+ if (get_elapsed_time(mWalkTime) >= mAttackSpeed)
{
- frames = 5;
- }
- mFrame = (get_elapsed_time(mWalkTime) * frames) / mAttackSpeed;
- if (mFrame >= frames) {
nextStep();
attack();
}
diff --git a/src/monster.cpp b/src/monster.cpp
index 8a7e2f32..26345a6c 100644
--- a/src/monster.cpp
+++ b/src/monster.cpp
@@ -40,9 +40,7 @@ Monster::logic()
{
if (mAction != STAND)
{
- mFrame = (get_elapsed_time(mWalkTime) * 4) / mWalkSpeed;
-
- if (mFrame >= 4 && mAction != MONSTER_DEAD)
+ if (get_elapsed_time(mWalkTime) >= mWalkSpeed && mAction != MONSTER_DEAD)
{
nextStep();
}
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index d21de6c4..6eb80d59 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -306,7 +306,6 @@ PlayerHandler::handleMapChangeMessage(MessageIn &msg)
player_node->setAction(Being::STAND);
player_node->stopAttack();
- player_node->mFrame = 0;
player_node->mX = x;
player_node->mY = y;
diff --git a/src/player.cpp b/src/player.cpp
index 46d3b938..52f2cdb0 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -47,19 +47,14 @@ Player::logic()
{
switch (mAction) {
case WALK:
- mFrame = (get_elapsed_time(mWalkTime) * 6) / mWalkSpeed;
- if (mFrame >= 6) {
+ if (get_elapsed_time(mWalkTime) >= mWalkSpeed)
+ {
nextStep();
}
break;
case ATTACK:
- int frames = 4;
- if (getWeapon() == 2)
+ if (get_elapsed_time(mWalkTime) >= mAttackSpeed)
{
- frames = 5;
- }
- mFrame = (get_elapsed_time(mWalkTime) * frames) / mAttackSpeed;
- if (mFrame >= frames) {
nextStep();
}
break;