Skip to content

Commit

Permalink
Fix #1102
Browse files Browse the repository at this point in the history
  • Loading branch information
marksamman committed Dec 18, 2014
1 parent 9ec473f commit 03cb25e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/player.cpp
Expand Up @@ -3752,6 +3752,10 @@ void Player::gainExperience(uint64_t gainExp, Creature* source)
return;
}

if (source && !source->getPlayer()) {
useStamina();
}

uint64_t oldExperience = experience;
addExperience(source, gainExp, true, true, true);

Expand All @@ -3772,16 +3776,10 @@ void Player::onGainExperience(uint64_t gainExp, Creature* target)
return;
}

if (target) {
if (gainExp > 0 && target->getMonster()) {
useStamina();
}

if (!target->getPlayer() && party && party->isSharedExperienceActive() && party->isSharedExperienceEnabled()) {
party->shareExperience(gainExp, target);
//We will get a share of the experience through the sharing mechanism
return;
}
if (target && !target->getPlayer() && party && party->isSharedExperienceActive() && party->isSharedExperienceEnabled()) {
party->shareExperience(gainExp, target);
//We will get a share of the experience through the sharing mechanism
return;
}

Creature::onGainExperience(gainExp, target);
Expand Down

0 comments on commit 03cb25e

Please sign in to comment.