summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-17 21:20:09 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-17 21:20:09 +0300
commiteed4e612309c788565eda120fa2ad30de50ca19e (patch)
tree4b8eb0738b2ee2876f59502faa4fede37600e6fd /src
parent2814eb1240ad6fc2da0e6c617c8fc5b7c4380f1e (diff)
downloadplus-eed4e612309c788565eda120fa2ad30de50ca19e.tar.gz
plus-eed4e612309c788565eda120fa2ad30de50ca19e.tar.bz2
plus-eed4e612309c788565eda120fa2ad30de50ca19e.tar.xz
plus-eed4e612309c788565eda120fa2ad30de50ca19e.zip
Simplify functions processSkillCasting and processSkillCasting2.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/beingrecv.cpp46
-rw-r--r--src/net/eathena/beingrecv.h9
2 files changed, 28 insertions, 27 deletions
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp
index db3a61b4c..3087824d5 100644
--- a/src/net/eathena/beingrecv.cpp
+++ b/src/net/eathena/beingrecv.cpp
@@ -919,32 +919,11 @@ void BeingRecv::processSkillCasting(Net::MessageIn &msg)
if (msg.getVersion() >= 20091124)
msg.readInt8("dispossable");
- if (!effectManager)
- return;
-
- if (srcId == BeingId_zero)
- {
- UNIMPLIMENTEDPACKETFIELD(0);
- return;
- }
- else if (dstId != BeingId_zero)
- { // being to being
- Being *const srcBeing = actorManager->findBeing(srcId);
- Being *const dstBeing = actorManager->findBeing(dstId);
- if (srcBeing)
- srcBeing->setAction(BeingAction::CAST, skillId);
- skillDialog->playCastingSrcEffect(skillId, srcBeing);
- skillDialog->playCastingDstEffect(skillId, dstBeing);
- }
- else if (dstX != 0 || dstY != 0)
- { // being to position
- Being *const srcBeing = actorManager->findBeing(srcId);
- if (srcBeing)
- srcBeing->setAction(BeingAction::CAST, skillId);
- skillDialog->playCastingDstTileEffect(skillId,
- dstX, dstY,
- castTime);
- }
+ processSkillCastingContinue(msg,
+ srcId, dstId,
+ dstX, dstY,
+ skillId,
+ castTime);
}
void BeingRecv::processSkillCasting2(Net::MessageIn &msg)
@@ -959,6 +938,21 @@ void BeingRecv::processSkillCasting2(Net::MessageIn &msg)
const int castTime = msg.readInt32("cast time");
msg.readInt32("skill range");
+ processSkillCastingContinue(msg,
+ srcId, dstId,
+ dstX, dstY,
+ skillId,
+ castTime);
+}
+
+void BeingRecv::processSkillCastingContinue(Net::MessageIn &msg,
+ const BeingId srcId,
+ const BeingId dstId,
+ const int dstX,
+ const int dstY,
+ const int skillId,
+ const int castTime)
+{
if (!effectManager)
return;
diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h
index 0f2b6fab7..1a005e31f 100644
--- a/src/net/eathena/beingrecv.h
+++ b/src/net/eathena/beingrecv.h
@@ -110,6 +110,7 @@ namespace EAthena
void processGraffiti(Net::MessageIn &msg);
void processSkillDamage(Net::MessageIn &msg);
void processNavigateTo(Net::MessageIn &msg);
+
Being *createBeing2(Net::MessageIn &msg,
const BeingId id,
const int32_t job,
@@ -117,7 +118,13 @@ namespace EAthena
void applyPlayerAction(Net::MessageIn &msg,
Being *const being,
const uint8_t type);
-
+ void processSkillCastingContinue(Net::MessageIn &msg,
+ const BeingId srcId,
+ const BeingId dstId,
+ const int dstX,
+ const int dstY,
+ const int skillId,
+ const int castTime);
} // namespace BeingRecv
} // namespace EAthena