summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-28 16:03:59 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-28 16:34:59 +0300
commitb96e6eeba6e1511568c8291bd8cb6a6d3706635c (patch)
treed021843c88d856f86f018547c30f1181290ffcbe /src/being
parent60859a71dd9794b0216cc7a60146d417e06dbbad (diff)
downloadplus-b96e6eeba6e1511568c8291bd8cb6a6d3706635c.tar.gz
plus-b96e6eeba6e1511568c8291bd8cb6a6d3706635c.tar.bz2
plus-b96e6eeba6e1511568c8291bd8cb6a6d3706635c.tar.xz
plus-b96e6eeba6e1511568c8291bd8cb6a6d3706635c.zip
Remove define EATHENA_SUPPORT from all code.
Now eathena like support enabled always.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/actorsprite.cpp2
-rw-r--r--src/being/being.cpp73
-rw-r--r--src/being/being.h10
-rw-r--r--src/being/localplayer.cpp6
-rw-r--r--src/being/playerinfo.cpp19
-rw-r--r--src/being/playerinfo.h6
6 files changed, 4 insertions, 112 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index 688bca340..b5eed97d0 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -382,7 +382,6 @@ void ActorSprite::updateStatusEffect(const int32_t index,
return;
if (effect->mIsPoison && getType() == ActorType::Player)
setPoison(newStatus == Enable_true);
-#ifdef EATHENA_SUPPORT
else if (effect->mIsCart && localPlayer == this)
setHaveCart(newStatus == Enable_true);
else if (effect->mIsRiding)
@@ -391,7 +390,6 @@ void ActorSprite::updateStatusEffect(const int32_t index,
setTrickDead(newStatus == Enable_true);
else if (effect->mIsPostDelay)
stopCast(newStatus == Enable_true);
-#endif
handleStatusEffect(effect, index, start);
}
diff --git a/src/being/being.cpp b/src/being/being.cpp
index a44870e13..285ed8ca0 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -40,10 +40,8 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
#include "being/playerrelations.h"
-#ifdef EATHENA_SUPPORT
#include "being/homunculusinfo.h"
#include "being/mercenaryinfo.h"
-#endif // EATHENA_SUPPORT
#include "const/utils/timer.h"
@@ -145,10 +143,8 @@ static const unsigned int SPEECH_MAX_TIME = 800;
#define for_each_badges() \
for (int f = 0; f < BadgeIndex::BadgeIndexSize; f++)
-#ifdef EATHENA_SUPPORT
#define for_each_horses(name) \
FOR_EACH (std::vector<AnimatedSprite*>::const_iterator, it, name)
-#endif
Being::Being(const BeingId id,
const ActorTypeT type,
@@ -205,20 +201,16 @@ Being::Being(const BeingId id,
mSpriteHide(new int[20]),
mSpriteDraw(new int[20]),
mComment(),
-#ifdef EATHENA_SUPPORT
mBuyBoard(),
mSellBoard(),
-#endif
mPets(),
mOwner(nullptr),
mSpecialParticle(nullptr),
-#ifdef EATHENA_SUPPORT
mChat(nullptr),
mHorseInfo(nullptr),
mDownHorseSprites(),
mUpHorseSprites(),
mSpiritParticles(),
-#endif
mX(0),
mY(0),
mCachedX(0),
@@ -250,9 +242,7 @@ Being::Being(const BeingId id,
mManner(0),
mAreaSize(11),
mCastEndTime(0),
-#ifdef EATHENA_SUPPORT
mCreatorId(BeingId_zero),
-#endif
mTeamId(0U),
mLook(0U),
mBadgesCount(0U),
@@ -281,12 +271,9 @@ Being::Being(const BeingId id,
setSubtype(subtype, 0);
if (mType == ActorType::Player
-#ifdef EATHENA_SUPPORT
|| mType == ActorType::Mercenary
|| mType == ActorType::Pet
- || mType == ActorType::Homunculus
-#endif
- )
+ || mType == ActorType::Homunculus)
{
mShowName = config.getBoolValue("visiblenames");
}
@@ -295,12 +282,8 @@ Being::Being(const BeingId id,
mGotComment = true;
}
-#ifdef EATHENA_SUPPORT
if (mType == ActorType::Portal ||
mType == ActorType::SkillUnit)
-#else
- if (mType == ActorType::Portal)
-#endif
{
mShowName = false;
}
@@ -340,10 +323,8 @@ Being::~Being()
delete2(mAnimationEffect);
delete2(mCastingEffect);
mBadgesCount = 0;
-#ifdef EATHENA_SUPPORT
delete2(mChat);
removeHorse();
-#endif
if (mOwner)
{
@@ -365,9 +346,7 @@ Being::~Being()
mPets.clear();
removeAllItemsParticles();
-#ifdef EATHENA_SUPPORT
mSpiritParticles.clear();
-#endif
}
void Being::createSpeechBubble() restrict2
@@ -401,7 +380,6 @@ void Being::setSubtype(const BeingTypeId subtype,
mYDiff = mInfo->getSortOffsetY();
}
break;
-#ifdef EATHENA_SUPPORT
case ActorType::Pet:
mInfo = PETDB::get(mSubType);
if (mInfo)
@@ -450,7 +428,6 @@ void Being::setSubtype(const BeingTypeId subtype,
mYDiff = mInfo->getSortOffsetY();
}
break;
-#endif
case ActorType::Npc:
mInfo = NPCDB::get(mSubType);
if (mInfo)
@@ -720,15 +697,11 @@ void Being::takeDamage(Being *restrict const attacker,
color = &userPalette->getColor(UserColorId::MISS);
}
}
- else if (mType == ActorType::Monster
-#ifdef EATHENA_SUPPORT
- ||
+ else if (mType == ActorType::Monster ||
mType == ActorType::Mercenary ||
mType == ActorType::Pet ||
mType == ActorType::Homunculus ||
- mType == ActorType::SkillUnit
-#endif
- )
+ mType == ActorType::SkillUnit)
{
if (attacker == localPlayer)
{
@@ -1592,14 +1565,9 @@ void Being::setAction(const BeingActionT &restrict action,
this,
false,
mX, mY);
-#ifdef EATHENA_SUPPORT
if (mType == ActorType::Monster ||
mType == ActorType::Npc ||
mType == ActorType::SkillUnit)
-#else
- if (mType == ActorType::Monster ||
- mType == ActorType::Npc)
-#endif
{
mYDiff = mInfo->getDeadSortOffsetY();
}
@@ -1637,12 +1605,10 @@ void Being::setAction(const BeingActionT &restrict action,
if (sprite)
sprite->play(currentAction);
}
-#ifdef EATHENA_SUPPORT
for_each_horses(mDownHorseSprites)
(*it)->play(currentAction);
for_each_horses(mUpHorseSprites)
(*it)->play(currentAction);
-#endif
mAction = action;
}
@@ -1710,12 +1676,10 @@ void Being::setDirection(const uint8_t direction) restrict2
sprite->setSpriteDirection(dir);
}
-#ifdef EATHENA_SUPPORT
for_each_horses(mDownHorseSprites)
(*it)->setSpriteDirection(dir);
for_each_horses(mUpHorseSprites)
(*it)->setSpriteDirection(dir);
-#endif
recalcSpritesOrder();
}
@@ -1821,12 +1785,10 @@ void Being::logic() restrict2
const int time = tick_time * MILLISECONDS_IN_A_TICK;
if (mEmotionSprite)
mEmotionSprite->update(time);
-#ifdef EATHENA_SUPPORT
for_each_horses(mDownHorseSprites)
(*it)->update(time);
for_each_horses(mUpHorseSprites)
(*it)->update(time);
-#endif
if (mCastEndTime != 0 && mCastEndTime < tick_time)
{
@@ -2445,7 +2407,6 @@ void Being::updateColors()
setDefaultNameColor(UserColorId::NPC);
mTextColor = &userPalette->getColor(UserColorId::NPC);
}
-#ifdef EATHENA_SUPPORT
else if (mType == ActorType::Pet)
{
setDefaultNameColor(UserColorId::PET);
@@ -2461,7 +2422,6 @@ void Being::updateColors()
setDefaultNameColor(UserColorId::SKILLUNIT);
mTextColor = &userPalette->getColor(UserColorId::SKILLUNIT);
}
-#endif
#ifdef TMWA_SUPPORT
else if (mType == ActorType::LocalPet)
{
@@ -3514,7 +3474,6 @@ void Being::drawPlayer(Graphics *restrict const graphics,
const int px = mPixelX - mapTileSize / 2 + offsetX;
// getActorY() + offsetY;
const int py = mPixelY - mapTileSize + offsetY;
-#ifdef EATHENA_SUPPORT
if (mHorseInfo)
{
for_each_horses(mDownHorseSprites)
@@ -3539,10 +3498,6 @@ void Being::drawPlayer(Graphics *restrict const graphics,
drawBeingCursor(graphics, px, py);
drawPlayerSpriteAt(graphics, px, py);
}
-#else
- drawBeingCursor(graphics, px, py);
- drawPlayerSpriteAt(graphics, px, py);
-#endif
}
}
@@ -3592,7 +3547,6 @@ void Being::drawMonster(Graphics *restrict const graphics,
drawMonsterSpriteAt(graphics, px, py);
}
-#ifdef EATHENA_SUPPORT
void Being::drawHomunculus(Graphics *restrict const graphics,
const int offsetX,
const int offsetY) const restrict2
@@ -3616,7 +3570,6 @@ void Being::drawMercenary(Graphics *restrict const graphics,
drawBeingCursor(graphics, px, py);
drawMercenarySpriteAt(graphics, px, py);
}
-#endif // EATHENA_SUPPORT
void Being::drawPortal(Graphics *restrict const graphics,
const int offsetX,
@@ -3645,7 +3598,6 @@ void Being::draw(Graphics *restrict const graphics,
offsetX,
offsetY);
break;
-#ifdef EATHENA_SUPPORT
case ActorType::Homunculus:
drawHomunculus(graphics,
offsetX,
@@ -3659,7 +3611,6 @@ void Being::draw(Graphics *restrict const graphics,
case ActorType::Pet:
case ActorType::SkillUnit:
case ActorType::Unknown:
-#endif
case ActorType::Monster:
drawMonster(graphics,
offsetX,
@@ -3836,7 +3787,6 @@ void Being::drawMonsterSpriteAt(Graphics *restrict const graphics,
}
}
-#ifdef EATHENA_SUPPORT
void Being::drawHomunculusSpriteAt(Graphics *restrict const graphics,
const int x,
const int y) const restrict2
@@ -3946,7 +3896,6 @@ void Being::drawMercenarySpriteAt(Graphics *restrict const graphics,
}
}
}
-#endif
void Being::drawPortalSpriteAt(Graphics *restrict const graphics,
const int x,
@@ -4465,12 +4414,10 @@ std::string Being::loadComment(const std::string &restrict name,
case ActorType::Portal:
case ActorType::LocalPet:
case ActorType::Avatar:
-#ifdef EATHENA_SUPPORT
case ActorType::Mercenary:
case ActorType::Homunculus:
case ActorType::Pet:
case ActorType::SkillUnit:
-#endif
default:
return "";
}
@@ -4505,12 +4452,10 @@ void Being::saveComment(const std::string &restrict name,
case ActorType::LocalPet:
case ActorType::Avatar:
case ActorType::Unknown:
-#ifdef EATHENA_SUPPORT
case ActorType::Pet:
case ActorType::Mercenary:
case ActorType::Homunculus:
case ActorType::SkillUnit:
-#endif
default:
return;
}
@@ -5150,7 +5095,6 @@ void Being::updateBadgesCount() restrict2
}
}
-#ifdef EATHENA_SUPPORT
void Being::setChat(ChatObject *restrict const obj) restrict2
{
delete mChat;
@@ -5172,7 +5116,6 @@ void Being::setBuyBoard(const std::string &restrict text) restrict2
updateName();
showShopBadge(mShop);
}
-#endif
void Being::enableShop(const bool b) restrict2
{
@@ -5183,20 +5126,12 @@ void Being::enableShop(const bool b) restrict2
bool Being::isBuyShopEnabled() const restrict2
{
-#ifdef EATHENA_SUPPORT
return mShop && (!serverFeatures->haveVending() || !mBuyBoard.empty());
-#else
- return mShop;
-#endif
}
bool Being::isSellShopEnabled() const restrict2
{
-#ifdef EATHENA_SUPPORT
return mShop && (!serverFeatures->haveVending() || !mSellBoard.empty());
-#else
- return mShop;
-#endif
}
void Being::serverRemove() restrict2 noexcept2
@@ -5240,7 +5175,6 @@ void Being::addCast(const int dstX,
}
}
-#ifdef EATHENA_SUPPORT
void Being::removeHorse() restrict2
{
delete_all(mUpHorseSprites);
@@ -5363,4 +5297,3 @@ void Being::stopCast(const bool b)
if (b && mAction == BeingAction::CAST)
setAction(BeingAction::STAND, 0);
}
-#endif
diff --git a/src/being/being.h b/src/being/being.h
index 9a9cfb1a8..a224403c7 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -956,7 +956,6 @@ class Being notfinal : public ActorSprite,
virtual int getLastAttackY() const restrict2
{ return mLastAttackY; }
-#ifdef EATHENA_SUPPORT
void drawHomunculus(Graphics *restrict const graphics,
const int offsetX,
const int offsetY) const
@@ -1002,7 +1001,6 @@ class Being notfinal : public ActorSprite,
BeingId getCreatorId() const noexcept2 A_WARN_UNUSED
{ return mCreatorId; }
-#endif
void setKarma(const int karma) restrict2 noexcept2
{ mKarma = karma; }
@@ -1077,7 +1075,6 @@ class Being notfinal : public ActorSprite,
const int x,
const int y) const restrict2 A_NONNULL(2);
-#ifdef EATHENA_SUPPORT
void drawHomunculusSpriteAt(Graphics *restrict const graphics,
const int x,
const int y) const restrict2 A_NONNULL(2);
@@ -1085,7 +1082,6 @@ class Being notfinal : public ActorSprite,
void drawMercenarySpriteAt(Graphics *restrict const graphics,
const int x,
const int y) const restrict2 A_NONNULL(2);
-#endif // EATHENA_SUPPORT
void drawCompound(Graphics *const graphics,
const int posX,
@@ -1224,20 +1220,16 @@ class Being notfinal : public ActorSprite,
int *restrict mSpriteHide A_NONNULLPOINTER;
int *restrict mSpriteDraw A_NONNULLPOINTER;
std::string mComment;
-#ifdef EATHENA_SUPPORT
std::string mBuyBoard;
std::string mSellBoard;
-#endif
std::vector<Being*> mPets;
Being *restrict mOwner;
Particle *restrict mSpecialParticle;
-#ifdef EATHENA_SUPPORT
ChatObject *restrict mChat;
HorseInfo *restrict mHorseInfo;
std::vector<AnimatedSprite*> mDownHorseSprites;
std::vector<AnimatedSprite*> mUpHorseSprites;
std::vector<Particle*> mSpiritParticles;
-#endif
int mX; // position in tiles
int mY; // position in tiles
@@ -1293,9 +1285,7 @@ class Being notfinal : public ActorSprite,
int mManner;
int mAreaSize;
int mCastEndTime;
-#ifdef EATHENA_SUPPORT
BeingId mCreatorId;
-#endif
uint16_t mTeamId;
uint16_t mLook;
uint16_t mBadgesCount;
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index abecee8de..62f30a015 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -480,9 +480,7 @@ void LocalPlayer::nextTile(unsigned char dir A_UNUSED = 0)
Being::nextTile();
}
-#ifdef EATHENA_SUPPORT
PlayerInfo::updateMoveAI();
-#endif
}
bool LocalPlayer::pickUp(FloorItem *const item)
@@ -821,9 +819,7 @@ void LocalPlayer::attack(Being *const target, const bool keep,
const BeingId targetId = target->getId();
playerHandler->attack(targetId, mServerAttack);
-#ifdef EATHENA_SUPPORT
PlayerInfo::updateAttackAi(targetId, mServerAttack);
-#endif
}
if (!keep)
@@ -1644,10 +1640,8 @@ void LocalPlayer::specialMove(const unsigned char direction)
void LocalPlayer::magicAttack() const
{
-#ifdef EATHENA_SUPPORT
if (Net::getNetworkType() != ServerType::TMWATHENA)
return;
-#endif
if (!chatWindow || !isAlive()
|| !playerHandler->canUseMagic())
{
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index 89fd30245..ff69a0d34 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -26,11 +26,9 @@
#include "being/localplayer.h"
-#ifdef EATHENA_SUPPORT
#include "being/homunculusinfo.h"
#include "being/mercenaryinfo.h"
#include "being/petinfo.h"
-#endif
#include "gui/windows/inventorywindow.h"
#include "gui/windows/npcdialog.h"
@@ -53,13 +51,11 @@ PlayerInfoBackend mData;
int mCharId = 0;
Inventory *mInventory = nullptr;
-#ifdef EATHENA_SUPPORT
Inventory *mCartInventory = nullptr;
MercenaryInfo *mMercenary = nullptr;
HomunculusInfo *mHomunculus = nullptr;
PetInfo *mPet = nullptr;
std::string mRoomName;
-#endif
Equipment *mEquipment = nullptr;
BeingId mPetBeingId = BeingId_zero;
GuildPositionFlags::Type mGuildPositionFlags = GuildPositionFlags::None;
@@ -211,12 +207,10 @@ Inventory *getStorageInventory()
return nullptr;
}
-#ifdef EATHENA_SUPPORT
Inventory *getCartInventory()
{
return mCartInventory;
}
-#endif
void clearInventory()
{
@@ -273,7 +267,6 @@ void useEquipItem(const Item *const item, const Sfx sfx)
{
if (item)
{
-#ifdef EATHENA_SUPPORT
if (item->getType() == ItemType::Card)
{
if (mProtectedItems.find(item->getId()) == mProtectedItems.end())
@@ -284,9 +277,7 @@ void useEquipItem(const Item *const item, const Sfx sfx)
ItemSoundManager::playSfx(item, ItemSoundEvent::USECARD);
}
}
- else
-#endif
- if (item->isEquipment() == Equipm_true)
+ else if (item->isEquipment() == Equipm_true)
{
if (item->isEquipped() == Equipped_true)
{
@@ -436,9 +427,7 @@ void init()
void deinit()
{
clearInventory();
-#ifdef EATHENA_SUPPORT
delete2(mMercenary);
-#endif
mPetBeingId = BeingId_zero;
}
@@ -464,9 +453,7 @@ void gameDestroyed()
{
delete2(mInventory);
delete2(mEquipment);
-#ifdef EATHENA_SUPPORT
delete2(mCartInventory);
-#endif
}
void stateChange(const StateT state)
@@ -477,9 +464,7 @@ void stateChange(const StateT state)
{
mInventory = new Inventory(InventoryType::Inventory);
mEquipment = new Equipment();
-#ifdef EATHENA_SUPPORT
mCartInventory = new Inventory(InventoryType::Cart);
-#endif
}
}
}
@@ -520,7 +505,6 @@ bool isItemProtected(const int id)
return mProtectedItems.find(id) != mProtectedItems.end();
}
-#ifdef EATHENA_SUPPORT
void setMercenary(MercenaryInfo *const info)
{
delete mMercenary;
@@ -631,7 +615,6 @@ bool isInRoom()
{
return !mRoomName.empty();
}
-#endif
void setGuildPositionFlags(const GuildPositionFlags::Type pos)
{
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index 269cd8221..d7c1be8fa 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -37,9 +37,7 @@
#include "utils/intmap.h"
-#ifdef EATHENA_SUPPORT
#include <string>
-#endif
/**
* Stat information storage structure.
@@ -164,9 +162,7 @@ namespace PlayerInfo
Inventory *getStorageInventory() A_WARN_UNUSED;
-#ifdef EATHENA_SUPPORT
Inventory *getCartInventory() A_WARN_UNUSED;
-#endif
/**
* Clears the player's inventory and equipment.
@@ -253,7 +249,6 @@ namespace PlayerInfo
bool isItemProtected(const int id);
-#ifdef EATHENA_SUPPORT
MercenaryInfo *getMercenary();
void setMercenary(MercenaryInfo *const info);
@@ -288,7 +283,6 @@ namespace PlayerInfo
void setRoomName(const std::string &name);
bool isInRoom();
-#endif
void setGuildPositionFlags(const GuildPositionFlags::Type pos);