summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-08 14:30:28 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-08 14:30:28 +0300
commitc9a31afec60a5085e0a3dbd26c15db397730a768 (patch)
tree08fe6126f1c1405a62be00425601613f19841601 /src/being
parentc43a3b024bf3da2b0c7b6eb177b662d63db41808 (diff)
downloadplus-c9a31afec60a5085e0a3dbd26c15db397730a768.tar.gz
plus-c9a31afec60a5085e0a3dbd26c15db397730a768.tar.bz2
plus-c9a31afec60a5085e0a3dbd26c15db397730a768.tar.xz
plus-c9a31afec60a5085e0a3dbd26c15db397730a768.zip
Add strong typed bool IsWeapon.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp20
-rw-r--r--src/being/being.h5
2 files changed, 13 insertions, 12 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index cec64c269..1a6e14fc4 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2468,7 +2468,7 @@ void Being::updateSprite(const unsigned int slot,
const int id,
const std::string &restrict color,
const ItemColor colorId,
- const bool isWeapon,
+ const IsWeapon isWeapon,
const bool isTempSprite) restrict2
{
if (!charServerHandler || slot >= charServerHandler->maxSprite())
@@ -2486,7 +2486,7 @@ void Being::setSprite(const unsigned int slot,
const int id,
std::string color,
const ItemColor colorId,
- const bool isWeapon,
+ const IsWeapon isWeapon,
const bool isTempSprite) restrict2
{
if (!charServerHandler || slot >= charServerHandler->maxSprite())
@@ -2514,7 +2514,7 @@ void Being::setSprite(const unsigned int slot,
removeSprite(slot);
mSpriteDraw[slot] = 0;
- if (isWeapon)
+ if (isWeapon == IsWeapon_true)
mEquippedWeapon = nullptr;
const int id1 = mSpriteIDs[slot];
if (id1)
@@ -2567,7 +2567,7 @@ void Being::setSprite(const unsigned int slot,
addItemParticles(id, info.getDisplay());
- if (isWeapon)
+ if (isWeapon == IsWeapon_true)
mEquippedWeapon = &ItemDB::get(id);
setAction(mAction, 0);
@@ -3376,7 +3376,7 @@ void Being::recalcSpritesOrder() restrict2
setSprite(remSprite, repIt->second,
mSpriteColors[remSprite],
ItemColor_one,
- false,
+ IsWeapon_false,
true);
}
else
@@ -3385,7 +3385,7 @@ void Being::recalcSpritesOrder() restrict2
ItemDB::get(repIt->second)
.getDyeColorsString(mHairColor),
ItemColor_one,
- false,
+ IsWeapon_false,
true);
}
updatedSprite[remSprite] = true;
@@ -3409,7 +3409,7 @@ void Being::recalcSpritesOrder() restrict2
setSprite(slot2, repIt->second,
mSpriteColors[slot2],
ItemColor_one,
- false,
+ IsWeapon_false,
true);
}
else
@@ -3419,7 +3419,7 @@ void Being::recalcSpritesOrder() restrict2
.getDyeColorsString(
mHairColor),
ItemColor_one,
- false,
+ IsWeapon_false,
true);
}
updatedSprite[slot2] = true;
@@ -3566,7 +3566,7 @@ void Being::recalcSpritesOrder() restrict2
id,
mSpriteColors[slot],
ItemColor_one,
- false,
+ IsWeapon_false,
true);
}
}
@@ -3583,7 +3583,7 @@ void Being::recalcSpritesOrder() restrict2
id,
mSpriteColors[slot],
ItemColor_one,
- false,
+ IsWeapon_false,
true);
}
}
diff --git a/src/being/being.h b/src/being/being.h
index 296038876..ad31cd144 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -28,6 +28,7 @@
#include "enums/gui/usercolorid.h"
+#include "enums/simpletypes/isweapon.h"
#include "enums/simpletypes/move.h"
#include "resources/beinginfo.h"
@@ -321,14 +322,14 @@ class Being notfinal : public ActorSprite,
const int id,
std::string color = "",
const ItemColor colorId = ItemColor_one,
- const bool isWeapon = false,
+ const IsWeapon isWeapon = IsWeapon_false,
const bool isTempSprite = false) restrict2;
void updateSprite(const unsigned int slot,
const int id,
const std::string &restrict color = "",
const ItemColor colorId = ItemColor_one,
- const bool isWeapon = false,
+ const IsWeapon isWeapon = IsWeapon_false,
const bool isTempSprite = false) restrict2;
void setSpriteID(const unsigned int slot,