summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/being/being.cpp18
-rw-r--r--src/being/being.h2
-rw-r--r--src/being/playerinfo.cpp1
-rw-r--r--src/being/playerinfo.h2
-rw-r--r--src/dropshortcut.cpp3
-rw-r--r--src/gui/windows/charcreatedialog.cpp2
-rw-r--r--src/gui/windows/equipmentwindow.cpp3
-rw-r--r--src/gui/windows/npcdialog.cpp2
-rw-r--r--src/gui/windows/outfitwindow.cpp3
-rw-r--r--src/itemshortcut.cpp3
-rw-r--r--src/itemsoundmanager.cpp3
-rw-r--r--src/net/ea/beinghandler.cpp20
-rw-r--r--src/net/ea/playerhandler.cpp4
-rw-r--r--src/net/ea/tradehandler.cpp1
-rw-r--r--src/net/eathena/beinghandler.cpp12
-rw-r--r--src/net/tmwa/beinghandler.cpp6
16 files changed, 33 insertions, 52 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 3bf1c4453..94e94161e 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -742,7 +742,7 @@ void Being::handleAttack(Being *const victim, const int damage,
setDirection(dir);
}
if (damage && victim->mType == PLAYER && victim->mAction == SIT)
- victim->setAction(STAND);
+ victim->setAction(STAND, 0);
if (mType == PLAYER)
{
@@ -795,7 +795,7 @@ void Being::handleSkill(Being *const victim, const int damage,
setDirection(dir);
}
if (damage && victim->mType == PLAYER && victim->mAction == SIT)
- victim->setAction(STAND);
+ victim->setAction(STAND, 0);
if (data)
{
if (damage > 0)
@@ -1337,7 +1337,7 @@ void Being::nextTile()
{
if (mPath.empty())
{
- setAction(STAND);
+ setAction(STAND, 0);
return;
}
@@ -1350,7 +1350,7 @@ void Being::nextTile()
if (!mMap || !mMap->getWalk(pos.x, pos.y, getWalkMask()))
{
- setAction(STAND);
+ setAction(STAND, 0);
return;
}
@@ -1366,7 +1366,7 @@ void Being::nextTile()
mY = pos.y;
const uint8_t height = mMap->getHeightOffset(mX, mY);
mOffsetY = height - mOldHeight;
- setAction(MOVE);
+ setAction(MOVE, 0);
}
void Being::logic()
@@ -1446,7 +1446,7 @@ void Being::logic()
}
if (mAction != MOVE)
- setAction(MOVE);
+ setAction(MOVE, 0);
// Update the player sprite direction.
// N.B.: We only change this if the distance is more than one pixel.
@@ -1480,7 +1480,7 @@ void Being::logic()
}
else if (mAction == MOVE)
{
- setAction(STAND);
+ setAction(STAND, 0);
}
}
else
@@ -1962,7 +1962,7 @@ void Being::setSprite(const unsigned int slot, const int id,
if (isWeapon)
mEquippedWeapon = &ItemDB::get(id);
- setAction(mAction);
+ setAction(mAction, 0);
}
if (!isTempSprite)
@@ -2899,7 +2899,7 @@ void Being::updatePercentHP()
{
mNumber = num;
if (updateNumber(mNumber))
- setAction(mAction);
+ setAction(mAction, 0);
}
}
}
diff --git a/src/being/being.h b/src/being/being.h
index 314787a56..dff4afbda 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -495,7 +495,7 @@ class Being : public ActorSprite, public ConfigListener
/**
* Sets the current action.
*/
- virtual void setAction(const Action &action, const int attackType = 0);
+ virtual void setAction(const Action &action, const int attackType);
/**
* Get the being's action currently performed.
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index bc7a6776b..a59acce38 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -24,7 +24,6 @@
#include "client.h"
#include "configuration.h"
#include "depricatedevent.h"
-#include "flooritem.h"
#include "inventory.h"
#include "itemsoundmanager.h"
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index 5311a24f4..bd4bff1b1 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -24,8 +24,6 @@
#include "equipment.h"
-#include "resources/soundinfo.h"
-
#include <map>
#include <string>
diff --git a/src/dropshortcut.cpp b/src/dropshortcut.cpp
index af9f6b0f3..c8f8e8ffe 100644
--- a/src/dropshortcut.cpp
+++ b/src/dropshortcut.cpp
@@ -30,9 +30,6 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
-#include "net/inventoryhandler.h"
-#include "net/net.h"
-
#include "debug.h"
DropShortcut *dropShortcut;
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index a61a6f8fd..f10f0030e 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -658,7 +658,7 @@ void CharCreateDialog::updatePlayer()
if (mPlayer)
{
mPlayer->setDirection(directions[mDirection]);
- mPlayer->setAction(actions[mAction]);
+ mPlayer->setAction(actions[mAction], 0);
}
}
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index a1dc03bac..1fe0387e4 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -41,9 +41,6 @@
#include "gui/widgets/button.h"
#include "gui/widgets/playerbox.h"
-#include "net/inventoryhandler.h"
-#include "net/net.h"
-
#include "resources/imageset.h"
#include "utils/dtor.h"
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index ea5813084..a302672f7 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -895,7 +895,7 @@ void NpcDialog::setAvatarAction(const int actionId)
{
Being *const being = mPlayerBox->getBeing();
if (being)
- being->setAction(static_cast<Being::Action>(actionId));
+ being->setAction(static_cast<Being::Action>(actionId), 0);
}
void NpcDialog::logic()
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index ff1088071..54d75e726 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -44,9 +44,6 @@
#include "utils/gettext.h"
-#include "net/inventoryhandler.h"
-#include "net/net.h"
-
#include <vector>
#include "debug.h"
diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp
index 2a95c7d4e..7f63eeb93 100644
--- a/src/itemshortcut.cpp
+++ b/src/itemshortcut.cpp
@@ -32,9 +32,6 @@
#include "gui/windows/skilldialog.h"
-#include "net/inventoryhandler.h"
-#include "net/net.h"
-
#include "debug.h"
ItemShortcut *itemShortcut[SHORTCUT_TABS];
diff --git a/src/itemsoundmanager.cpp b/src/itemsoundmanager.cpp
index c77f0a08f..9107a4048 100644
--- a/src/itemsoundmanager.cpp
+++ b/src/itemsoundmanager.cpp
@@ -22,15 +22,12 @@
#include "flooritem.h"
#include "item.h"
-#include "logger.h"
#include "soundmanager.h"
#include "being/localplayer.h"
#include "resources/iteminfo.h"
-#include "resources/db/itemdb.h"
-
#include "debug.h"
void ItemSoundManager::playSfx(const Item *const item,
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index 3392905f5..4e08f5466 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -179,13 +179,13 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
if (spawnId)
{
- dstBeing->setAction(Being::SPAWN);
+ dstBeing->setAction(Being::SPAWN, 0);
}
else if (visible)
{
dstBeing->clearPath();
dstBeing->setActionTime(tick_time);
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
}
// Prevent division by 0 when calculating frame
@@ -298,7 +298,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
msg.readCoordinatePair(srcX, srcY, dstX, dstY);
if (!disguiseId)
{
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
dstBeing->setTileCoords(srcX, srcY);
if (serverVersion < 10)
dstBeing->setDestination(dstX, dstY);
@@ -364,7 +364,7 @@ void BeingHandler::processBeingMove2(Net::MessageIn &msg) const
msg.readCoordinatePair(srcX, srcY, dstX, dstY);
msg.readInt32(); // Server tick
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
dstBeing->setTileCoords(srcX, srcY);
dstBeing->setDestination(dstX, dstY);
if (dstBeing->getType() == Being::PLAYER)
@@ -405,7 +405,7 @@ void BeingHandler::processBeingRemove(Net::MessageIn &msg) const
{
if (dstBeing->getCurrentAction() != Being::DEAD)
{
- dstBeing->setAction(Being::DEAD);
+ dstBeing->setAction(Being::DEAD, 0);
dstBeing->recalcSpritesOrder();
}
if (dstBeing->getName() == "Jack O" && killStats)
@@ -441,7 +441,7 @@ void BeingHandler::processBeingResurrect(Net::MessageIn &msg) const
player_node->stopAttack();
if (msg.readInt8() == 1)
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
}
@@ -509,12 +509,12 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
break;
// tmw server can send here garbage?
// if (srcBeing)
-// srcBeing->setAction(Being::DEAD);
+// srcBeing->setAction(Being::DEAD, 0);
case 0x02: // Sit
if (srcBeing)
{
- srcBeing->setAction(Being::SIT);
+ srcBeing->setAction(Being::SIT, 0);
if (srcBeing->getType() == Being::PLAYER)
{
srcBeing->setMoveTime();
@@ -527,7 +527,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg) const
case 0x03: // Stand up
if (srcBeing)
{
- srcBeing->setAction(Being::STAND);
+ srcBeing->setAction(Being::STAND, 0);
if (srcBeing->getType() == Being::PLAYER)
{
srcBeing->setMoveTime();
@@ -712,7 +712,7 @@ void BeingHandler::processPlayerStop(Net::MessageIn &msg) const
const uint16_t y = msg.readInt16();
dstBeing->setTileCoords(x, y);
if (dstBeing->getCurrentAction() == Being::MOVE)
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
}
}
}
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 31359ae37..d3667b78a 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -198,7 +198,7 @@ void PlayerHandler::processPlayerWarp(Net::MessageIn &msg) const
}
}
- player_node->setAction(Being::STAND);
+ player_node->setAction(Being::STAND, 0);
player_node->setTileCoords(x, y);
player_node->updatePets();
player_node->navigateClean();
@@ -398,7 +398,7 @@ void PlayerHandler::processPlayerStatUpdate1(Net::MessageIn &msg) const
deathNotice->addActionListener(&deathListener);
if (player_node->getCurrentAction() != Being::DEAD)
{
- player_node->setAction(Being::DEAD);
+ player_node->setAction(Being::DEAD, 0);
player_node->recalcSpritesOrder();
}
}
diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp
index c4654087b..eb0441a19 100644
--- a/src/net/ea/tradehandler.cpp
+++ b/src/net/ea/tradehandler.cpp
@@ -34,7 +34,6 @@
#include "gui/windows/confirmdialog.h"
#include "gui/windows/tradewindow.h"
-#include "net/inventoryhandler.h"
#include "net/net.h"
#include "net/ea/eaprotocol.h"
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index 685f19f16..739e2397d 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -569,20 +569,20 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
switch (type)
{
case 0:
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
player_node->imitateAction(dstBeing, Being::STAND);
break;
case 1:
if (dstBeing->getCurrentAction() != Being::DEAD)
{
- dstBeing->setAction(Being::DEAD);
+ dstBeing->setAction(Being::DEAD, 0);
dstBeing->recalcSpritesOrder();
}
break;
case 2:
- dstBeing->setAction(Being::SIT);
+ dstBeing->setAction(Being::SIT, 0);
player_node->imitateAction(dstBeing, Being::SIT);
break;
@@ -685,13 +685,13 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
if (spawnId)
{
- dstBeing->setAction(Being::SPAWN);
+ dstBeing->setAction(Being::SPAWN, 0);
}
else if (visible)
{
dstBeing->clearPath();
dstBeing->setActionTime(tick_time);
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
}
// Prevent division by 0 when calculating frame
@@ -771,7 +771,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
{
uint16_t srcX, srcY, dstX, dstY;
msg.readCoordinatePair(srcX, srcY, dstX, dstY);
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
dstBeing->setTileCoords(srcX, srcY);
dstBeing->setDestination(dstX, dstY);
}
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index cc72a3148..b127517ea 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -594,20 +594,20 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
switch (type)
{
case 0:
- dstBeing->setAction(Being::STAND);
+ dstBeing->setAction(Being::STAND, 0);
player_node->imitateAction(dstBeing, Being::STAND);
break;
case 1:
if (dstBeing->getCurrentAction() != Being::DEAD)
{
- dstBeing->setAction(Being::DEAD);
+ dstBeing->setAction(Being::DEAD, 0);
dstBeing->recalcSpritesOrder();
}
break;
case 2:
- dstBeing->setAction(Being::SIT);
+ dstBeing->setAction(Being::SIT, 0);
player_node->imitateAction(dstBeing, Being::SIT);
break;