summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-27 21:56:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-27 21:56:44 +0300
commit7f7625e913fd1d131feef4f816c90c33e79316d1 (patch)
treeec5a647b07188f4f3f9005313dfa2856b04d9882
parent5f61b3a8ec592bc251a08366656b55bdfe3736a0 (diff)
downloadplus-7f7625e913fd1d131feef4f816c90c33e79316d1.tar.gz
plus-7f7625e913fd1d131feef4f816c90c33e79316d1.tar.bz2
plus-7f7625e913fd1d131feef4f816c90c33e79316d1.tar.xz
plus-7f7625e913fd1d131feef4f816c90c33e79316d1.zip
Remove some evol server checks.
-rw-r--r--src/being/being.cpp90
-rw-r--r--src/commands.cpp2
-rw-r--r--src/gui/widgets/tabs/setup_chat.cpp2
-rw-r--r--src/net/ea/beinghandler.cpp3
-rw-r--r--src/resources/db/npcdb.cpp2
-rw-r--r--src/resources/db/petdb.cpp2
-rw-r--r--src/resources/iteminfo.cpp2
7 files changed, 34 insertions, 69 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 487749a0d..1523c10a0 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -1032,45 +1032,31 @@ void Being::fireMissile(Being *const victim, const std::string &particle) const
std::string Being::getSitAction() const
{
- if (serverVersion < 0)
+ if (mMap)
{
- return SpriteAction::SIT;
- }
- else
- {
- if (mMap)
- {
- const unsigned char mask = mMap->getBlockMask(mX, mY);
- if (mask & BlockMask::GROUNDTOP)
- return SpriteAction::SITTOP;
- else if (mask & BlockMask::AIR)
- return SpriteAction::SITSKY;
- else if (mask & BlockMask::WATER)
- return SpriteAction::SITWATER;
- }
- return SpriteAction::SIT;
+ const unsigned char mask = mMap->getBlockMask(mX, mY);
+ if (mask & BlockMask::GROUNDTOP)
+ return SpriteAction::SITTOP;
+ else if (mask & BlockMask::AIR)
+ return SpriteAction::SITSKY;
+ else if (mask & BlockMask::WATER)
+ return SpriteAction::SITWATER;
}
+ return SpriteAction::SIT;
}
std::string Being::getMoveAction() const
{
- if (serverVersion < 0)
- {
- return SpriteAction::MOVE;
- }
- else
+ if (mMap)
{
- if (mMap)
- {
- const unsigned char mask = mMap->getBlockMask(mX, mY);
- if (mask & BlockMask::AIR)
- return SpriteAction::FLY;
- else if (mask & BlockMask::WATER)
- return SpriteAction::SWIM;
- }
- return SpriteAction::MOVE;
+ const unsigned char mask = mMap->getBlockMask(mX, mY);
+ if (mask & BlockMask::AIR)
+ return SpriteAction::FLY;
+ else if (mask & BlockMask::WATER)
+ return SpriteAction::SWIM;
}
+ return SpriteAction::MOVE;
}
std::string Being::getWeaponAttackAction(const ItemInfo *const weapon) const
@@ -1101,43 +1087,29 @@ std::string Being::getAttackAction(const Attack *const attack1) const
if (!attack1)
return SpriteAction::ATTACK;
- if (serverVersion < 0)
+ if (mMap)
{
- return attack1->mAction;
- }
- else
- {
- if (mMap)
- {
- const unsigned char mask = mMap->getBlockMask(mX, mY);
- if (mask & BlockMask::AIR)
- return attack1->mSkyAction;
- else if (mask & BlockMask::WATER)
- return attack1->mWaterAction;
- }
- return attack1->mAction;
+ const unsigned char mask = mMap->getBlockMask(mX, mY);
+ if (mask & BlockMask::AIR)
+ return attack1->mSkyAction;
+ else if (mask & BlockMask::WATER)
+ return attack1->mWaterAction;
}
+ return attack1->mAction;
}
#define getSpriteAction(func, action) \
std::string Being::get##func##Action() const \
{ \
- if (serverVersion < 0) \
- { \
- return SpriteAction::action; \
- } \
- else \
+ if (mMap) \
{ \
- if (mMap) \
- { \
- const unsigned char mask = mMap->getBlockMask(mX, mY); \
- if (mask & BlockMask::AIR) \
- return SpriteAction::action##SKY; \
- else if (mask & BlockMask::WATER) \
- return SpriteAction::action##WATER; \
- } \
- return SpriteAction::action; \
+ const unsigned char mask = mMap->getBlockMask(mX, mY); \
+ if (mask & BlockMask::AIR) \
+ return SpriteAction::action##SKY; \
+ else if (mask & BlockMask::WATER) \
+ return SpriteAction::action##WATER; \
} \
+ return SpriteAction::action; \
}
getSpriteAction(Dead, DEAD)
@@ -3028,7 +3000,7 @@ void Being::setEmote(const uint8_t emotion, const int emote_time)
void Being::updatePercentHP()
{
- if (!mMaxHP || !serverVersion)
+ if (!mMaxHP)
return;
if (mHP)
{
diff --git a/src/commands.cpp b/src/commands.cpp
index 62cb58049..2b64e8d6f 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1278,7 +1278,7 @@ impHandler0(createItems)
if (colors >= 255)
colors = 254;
- if (!colors || serverVersion < 1)
+ if (!colors)
{
dialog->addItem(id, 1, 100, 0);
}
diff --git a/src/gui/widgets/tabs/setup_chat.cpp b/src/gui/widgets/tabs/setup_chat.cpp
index 897ae5d2a..e36666844 100644
--- a/src/gui/widgets/tabs/setup_chat.cpp
+++ b/src/gui/widgets/tabs/setup_chat.cpp
@@ -33,8 +33,6 @@
#include "debug.h"
-extern int serverVersion;
-
Setup_Chat::Setup_Chat(const Widget2 *const widget) :
SetupTabScroll(widget)
{
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index b7e9a0467..f5df5c55c 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -55,6 +55,7 @@
#include "debug.h"
extern int serverVersion;
+extern unsigned int tmwServerVersion;
namespace Ea
{
@@ -230,7 +231,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
uint16_t gloves;
if (dstBeing->getType() == ActorType::MONSTER)
{
- if (serverVersion > 0)
+ if (serverVersion > 0 || tmwServerVersion >= 0x0E0701)
{
const int hp = msg.readInt32();
const int maxHP = msg.readInt32();
diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp
index 2301046df..2c840ace2 100644
--- a/src/resources/db/npcdb.cpp
+++ b/src/resources/db/npcdb.cpp
@@ -39,8 +39,6 @@ namespace
bool mLoaded = false;
}
-extern int serverVersion;
-
void NPCDB::load()
{
if (mLoaded)
diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp
index 2d7417f45..19ce3e883 100644
--- a/src/resources/db/petdb.cpp
+++ b/src/resources/db/petdb.cpp
@@ -40,8 +40,6 @@ namespace
bool mLoaded = false;
}
-extern int serverVersion;
-
void PETDB::load()
{
if (mLoaded)
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 55ca5f44d..e36aa3942 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -38,8 +38,6 @@
#include "debug.h"
-extern int serverVersion;
-
ItemInfo::ItemInfo() :
mMissileParticleFile(),
mDisplay(),