mirror of
https://github.com/edubart/otclient.git
synced 2025-04-29 09:19:19 +02:00
Fix uninitialized oldMaxMana variable in Player::setMana (#1152)
This commit is contained in:
parent
1e29b5cb01
commit
9ce2cab9ae
@ -59,7 +59,7 @@ LocalPlayer::LocalPlayer()
|
||||
|
||||
void LocalPlayer::lockWalk(int millis)
|
||||
{
|
||||
m_walkLockExpiration = std::max<int>(m_walkLockExpiration, (ticks_t) g_clock.millis() + millis);
|
||||
m_walkLockExpiration = std::max<ticks_t>(m_walkLockExpiration, g_clock.millis() + millis);
|
||||
}
|
||||
|
||||
bool LocalPlayer::canWalk(Otc::Direction)
|
||||
@ -102,8 +102,9 @@ void LocalPlayer::walk(const Position& oldPos, const Position& newPos)
|
||||
if(newPos == m_lastPrewalkDestination) {
|
||||
updateWalk();
|
||||
// was to another direction, replace the walk
|
||||
} else
|
||||
} else {
|
||||
Creature::walk(oldPos, newPos);
|
||||
}
|
||||
}
|
||||
// no prewalk was going on, this must be an server side automated walk
|
||||
else {
|
||||
@ -259,8 +260,9 @@ void LocalPlayer::updateWalkOffset(int totalPixelsWalked)
|
||||
m_walkOffset.x = totalPixelsWalked;
|
||||
else if(m_direction == Otc::West || m_direction == Otc::NorthWest || m_direction == Otc::SouthWest)
|
||||
m_walkOffset.x = -totalPixelsWalked;
|
||||
} else
|
||||
} else {
|
||||
Creature::updateWalkOffset(totalPixelsWalked);
|
||||
}
|
||||
}
|
||||
|
||||
void LocalPlayer::updateWalk()
|
||||
@ -425,7 +427,7 @@ void LocalPlayer::setMana(double mana, double maxMana)
|
||||
{
|
||||
if(m_mana != mana || m_maxMana != maxMana) {
|
||||
double oldMana = m_mana;
|
||||
double oldMaxMana;
|
||||
double oldMaxMana = m_maxMana;
|
||||
m_mana = mana;
|
||||
m_maxMana = maxMana;
|
||||
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
double getStamina() { return m_stamina; }
|
||||
double getRegenerationTime() { return m_regenerationTime; }
|
||||
double getOfflineTrainingTime() { return m_offlineTrainingTime; }
|
||||
std::vector<int> getSpells() { return m_spells; }
|
||||
const std::vector<int>& getSpells() { return m_spells; }
|
||||
ItemPtr getInventoryItem(Otc::InventorySlot inventory) { return m_inventoryItems[inventory]; }
|
||||
int getBlessings() { return m_blessings; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user