summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-08 19:35:18 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-08 19:35:18 +0300
commit93e5a6fbfba642e4e3ff85dcf7bc3c02bada5649 (patch)
tree3561909ed91fb58b03a7d5bd815fcff91bfe5e30 /src/being
parent8685a2564a96c6819fc0854891293747232fe02a (diff)
downloadplus-93e5a6fbfba642e4e3ff85dcf7bc3c02bada5649.tar.gz
plus-93e5a6fbfba642e4e3ff85dcf7bc3c02bada5649.tar.bz2
plus-93e5a6fbfba642e4e3ff85dcf7bc3c02bada5649.tar.xz
plus-93e5a6fbfba642e4e3ff85dcf7bc3c02bada5649.zip
Add setWeaponId into Being class.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp8
-rw-r--r--src/being/being.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 18535ab9e..7cd645b17 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2604,6 +2604,14 @@ void Being::setSprite(const unsigned int slot,
beingEquipmentWindow->updateBeing(this);
}
+void Being::setWeaponId(const int id) restrict2
+{
+ if (id == 0)
+ mEquippedWeapon = nullptr;
+ else
+ mEquippedWeapon = &ItemDB::get(id);
+}
+
void Being::setTempSprite(const unsigned int slot,
const int id,
std::string color,
diff --git a/src/being/being.h b/src/being/being.h
index bb9951f56..7e3ec2b55 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -326,6 +326,8 @@ class Being notfinal : public ActorSprite,
const IsWeapon isWeapon,
const int *const cards) restrict2;
+ void setWeaponId(const int id) restrict2;
+
void setTempSprite(const unsigned int slot,
const int id,
std::string color,