diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-06 01:09:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-06 01:09:47 +0300 |
commit | 7fa78a35307227453ab55c7452e348a40cd41d65 (patch) | |
tree | 1d3e16a94bed043877306f1c47b3992add85b3be /src/net | |
parent | a87db81b6b7551a248e31e2850577aefda092538 (diff) | |
download | manaplus-7fa78a35307227453ab55c7452e348a40cd41d65.tar.gz manaplus-7fa78a35307227453ab55c7452e348a40cd41d65.tar.bz2 manaplus-7fa78a35307227453ab55c7452e348a40cd41d65.tar.xz manaplus-7fa78a35307227453ab55c7452e348a40cd41d65.zip |
Add strong typed bool type Modifiable.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/guildhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/skillhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.cpp | 17 | ||||
-rw-r--r-- | src/net/eathena/homunculushandler.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/mercenaryhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/skillhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 17 | ||||
-rw-r--r-- | src/net/tmwa/skillhandler.cpp | 2 |
8 files changed, 31 insertions, 21 deletions
diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp index 3b15062ff..1b8302ace 100644 --- a/src/net/ea/guildhandler.cpp +++ b/src/net/ea/guildhandler.cpp @@ -343,7 +343,7 @@ void GuildHandler::processGuildSkillInfo(Net::MessageIn &msg) const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); const std::string name = msg.readString(24, "skill name"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); PlayerInfo::setSkillLevel(skillId, level); if (skillDialog) { diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp index 2aeb41357..f05d1f18a 100644 --- a/src/net/ea/skillhandler.cpp +++ b/src/net/ea/skillhandler.cpp @@ -43,7 +43,7 @@ void SkillHandler::processPlayerSkillUp(Net::MessageIn &msg) const int level = msg.readInt16("skill level"); const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); if (skillDialog && PlayerInfo::getSkillLevel(skillId) != level) skillDialog->playUpdateEffect(skillId); diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index b527aae70..3c442af82 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -390,13 +390,18 @@ void GeneralHandler::gameStarted() const // protection against double addition attributes. statusWindow->clearAttributes(); - statusWindow->addAttribute(Attributes::STR, _("Strength"), "str", true); - statusWindow->addAttribute(Attributes::AGI, _("Agility"), "agi", true); - statusWindow->addAttribute(Attributes::VIT, _("Vitality"), "vit", true); + statusWindow->addAttribute(Attributes::STR, + _("Strength"), "str", Modifiable_true); + statusWindow->addAttribute(Attributes::AGI, + _("Agility"), "agi", Modifiable_true); + statusWindow->addAttribute(Attributes::VIT, + _("Vitality"), "vit", Modifiable_true); statusWindow->addAttribute(Attributes::INT, - _("Intelligence"), "int", true); - statusWindow->addAttribute(Attributes::DEX, _("Dexterity"), "dex", true); - statusWindow->addAttribute(Attributes::LUK, _("Luck"), "luk", true); + _("Intelligence"), "int", Modifiable_true); + statusWindow->addAttribute(Attributes::DEX, + _("Dexterity"), "dex", Modifiable_true); + statusWindow->addAttribute(Attributes::LUK, + _("Luck"), "luk", Modifiable_true); statusWindow->addAttribute(Attributes::ATK, _("Attack")); statusWindow->addAttribute(Attributes::DEF, _("Defense")); diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp index e3f83cd39..2bfe358c2 100644 --- a/src/net/eathena/homunculushandler.cpp +++ b/src/net/eathena/homunculushandler.cpp @@ -108,7 +108,7 @@ void HomunculusHandler::processHomunculusSkills(Net::MessageIn &msg) const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); const std::string name = msg.readString(24, "skill name"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); PlayerInfo::setSkillLevel(skillId, level); if (skillDialog) { @@ -202,7 +202,7 @@ void HomunculusHandler::processHomunculusSkillUp(Net::MessageIn &msg) const int level = msg.readInt16("level"); const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); if (skillDialog && PlayerInfo::getSkillLevel(skillId) != level) skillDialog->playUpdateEffect(skillId); diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index 1bc35a72f..ebdba730e 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -136,7 +136,7 @@ void MercenaryHandler::processMercenarySkills(Net::MessageIn &msg) const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); const std::string name = msg.readString(24, "skill name"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); PlayerInfo::setSkillLevel(skillId, level); if (skillDialog) { diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp index 413ff103f..445a0b78b 100644 --- a/src/net/eathena/skillhandler.cpp +++ b/src/net/eathena/skillhandler.cpp @@ -213,7 +213,7 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); const std::string name = msg.readString(24, "skill name"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); const int oldLevel = PlayerInfo::getSkillLevel(skillId); if (oldLevel && oldLevel != level) updateSkill = skillId; @@ -245,7 +245,7 @@ void SkillHandler::processSkillAdd(Net::MessageIn &msg) const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); const std::string name = msg.readString(24, "skill name"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); const int oldLevel = PlayerInfo::getSkillLevel(skillId); if (oldLevel && oldLevel != level) updateSkill = skillId; @@ -272,7 +272,7 @@ void SkillHandler::processSkillUpdate(Net::MessageIn &msg) const int level = msg.readInt16("skill level"); const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); const int oldLevel = PlayerInfo::getSkillLevel(skillId); if (oldLevel && oldLevel != level) updateSkill = skillId; diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index bf7ff4148..548ee7b8f 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -342,18 +342,23 @@ void GeneralHandler::gameStarted() const statusWindow->clearAttributes(); // TRANSLATORS: player stat - statusWindow->addAttribute(Attributes::STR, _("Strength"), "str", true); + statusWindow->addAttribute(Attributes::STR, + _("Strength"), "str", Modifiable_true); // TRANSLATORS: player stat - statusWindow->addAttribute(Attributes::AGI, _("Agility"), "agi", true); + statusWindow->addAttribute(Attributes::AGI, + _("Agility"), "agi", Modifiable_true); // TRANSLATORS: player stat - statusWindow->addAttribute(Attributes::VIT, _("Vitality"), "vit", true); + statusWindow->addAttribute(Attributes::VIT, + _("Vitality"), "vit", Modifiable_true); // TRANSLATORS: player stat statusWindow->addAttribute(Attributes::INT, - _("Intelligence"), "int", true); + _("Intelligence"), "int", Modifiable_true); // TRANSLATORS: player stat - statusWindow->addAttribute(Attributes::DEX, _("Dexterity"), "dex", true); + statusWindow->addAttribute(Attributes::DEX, + _("Dexterity"), "dex", Modifiable_true); // TRANSLATORS: player stat - statusWindow->addAttribute(Attributes::LUK, _("Luck"), "luk", true); + statusWindow->addAttribute(Attributes::LUK, + _("Luck"), "luk", Modifiable_true); // TRANSLATORS: player stat statusWindow->addAttribute(Attributes::ATK, _("Attack")); // TRANSLATORS: player stat diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp index b88e9e509..1b8678682 100644 --- a/src/net/tmwa/skillhandler.cpp +++ b/src/net/tmwa/skillhandler.cpp @@ -135,7 +135,7 @@ void SkillHandler::processPlayerSkills(Net::MessageIn &msg) const int sp = msg.readInt16("sp"); const int range = msg.readInt16("range"); msg.skip(24, "unused"); - const int up = msg.readUInt8("up flag"); + const Modifiable up = fromBool(msg.readUInt8("up flag"), Modifiable); const int oldLevel = PlayerInfo::getSkillLevel(skillId); if (oldLevel && oldLevel != level) updateSkill = skillId; |