summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-17 13:36:17 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-17 13:36:17 +0300
commitd220dec50c6fb9218092e8caab87fcee6ef11e71 (patch)
tree0f5068c2882e15996acd34fd63ebf43bce5baebc /src/being.cpp
parent66f684799ad742d6214a6e3e9107219bef48b3f0 (diff)
downloadmanaplus-d220dec50c6fb9218092e8caab87fcee6ef11e71.tar.gz
manaplus-d220dec50c6fb9218092e8caab87fcee6ef11e71.tar.bz2
manaplus-d220dec50c6fb9218092e8caab87fcee6ef11e71.tar.xz
manaplus-d220dec50c6fb9218092e8caab87fcee6ef11e71.zip
Use actual skill level in processing skill attack.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 6f530f9e8..09ec02389 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -762,7 +762,7 @@ void Being::handleAttack(Being *const victim, const int damage,
}
void Being::handleSkill(Being *const victim, const int damage,
- const int skillId)
+ const int skillId, const int skillLevel)
{
if (!victim || !mInfo || !skillDialog)
return;
@@ -770,9 +770,10 @@ void Being::handleSkill(Being *const victim, const int damage,
if (this != player_node)
setAction(Being::ATTACK, 1);
- const SkillInfo *const skill = skillDialog->getSkill(skillId);
- if (skill)
- fireMissile(victim, skill->data->particle);
+ SkillInfo *const skill = skillDialog->getSkill(skillId);
+ const SkillData *const data = skill ? skill->getData1(skillLevel) : nullptr;
+ if (data)
+ fireMissile(victim, data->particle);
#ifdef MANASERV_SUPPORT
if (Net::getNetworkType() != ServerInfo::MANASERV)
@@ -792,12 +793,12 @@ void Being::handleSkill(Being *const victim, const int damage,
if (damage && victim->mType == PLAYER && victim->mAction == SIT)
victim->setAction(STAND);
- if (skill)
+ if (data)
{
if (damage > 0)
- sound.playSfx(skill->data->soundHit, mX, mY);
+ sound.playSfx(data->soundHit, mX, mY);
else
- sound.playSfx(skill->data->soundMiss, mX, mY);
+ sound.playSfx(data->soundMiss, mX, mY);
}
else
{