Skip to content

Commit

Permalink
math and sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
omeranha committed May 2, 2022
1 parent 515daa4 commit fa5f25d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,8 @@ void Combat::doCombatHealth(Creature* caster, Creature* target, CombatDamage& da
double_t fatalChance = caster->getPlayer()->getInventoryItem(CONST_SLOT_LEFT)->getFatalChance();
if (damage.primary.type != COMBAT_HEALING && fatalChance > 0 && uniform_random(1, 100) <= fatalChance) {
damage.fatal = true;
damage.primary.value += std::round(damage.primary.value * 0.6);
damage.secondary.value += std::round(damage.secondary.value * 0.6);
damage.primary.value += static_cast<int32_t>(std::round(damage.primary.value * 1.6));
damage.secondary.value += static_cast<int32_t>(std::round(damage.secondary.value * 1.6));
}
}
}
Expand Down Expand Up @@ -960,8 +960,8 @@ void Combat::doCombatHealth(Creature* caster, const Position& position, const Ar
double_t fatalChance = caster->getPlayer()->getInventoryItem(CONST_SLOT_LEFT)->getFatalChance();
if (damage.primary.type != COMBAT_HEALING && fatalChance > 0 && uniform_random(1, 100) <= fatalChance) {
damage.fatal = true;
damage.primary.value += std::round(damage.primary.value * 0.6);
damage.secondary.value += std::round(damage.secondary.value * 0.6);
damage.primary.value += static_cast<int32_t>(std::round(damage.primary.value * 1.6));
damage.secondary.value += static_cast<int32_t>(std::round(damage.secondary.value * 1.6));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1992,13 +1992,13 @@ void Player::onThink(uint32_t interval)
auto it = conditions.begin(); auto end = conditions.end();
while (it != end) {
ConditionType_t type = (*it)->getType();
uint8_t spellId = (*it)->getSubId();
uint32_t spellId = (*it)->getSubId();
int32_t ticks = (*it)->getTicks();
int32_t newTicks = (ticks <= 2000) ? 0 : ticks - 2000;
triggered = true;
if (type == CONDITION_SPELLCOOLDOWN || (type == CONDITION_SPELLGROUPCOOLDOWN && spellId > SPELLGROUP_SUPPORT)) {
(*it)->setTicks(newTicks);
type == CONDITION_SPELLGROUPCOOLDOWN ? sendSpellGroupCooldown(static_cast<SpellGroup_t>(spellId), newTicks) : sendSpellCooldown(spellId, newTicks);
type == CONDITION_SPELLGROUPCOOLDOWN ? sendSpellGroupCooldown(static_cast<SpellGroup_t>(spellId), newTicks) : sendSpellCooldown(static_cast<uint8_t>(spellId), newTicks);
}
++it;
}
Expand Down

0 comments on commit fa5f25d

Please sign in to comment.