Hunger and thirst clamping within larger ranges

This commit is contained in:
KimLS 2014-10-03 13:42:39 -07:00
parent 16c5ead887
commit 61545beff2

View File

@ -39,15 +39,10 @@
extern volatile bool RunLoops;
#include "../common/features.h"
#include "masterentity.h"
#include "worldserver.h"
#include "../common/misc.h"
#include "zonedb.h"
#include "../common/spdat.h"
#include "net.h"
#include "../common/packet_dump.h"
#include "../common/packet_functions.h"
#include "petitions.h"
#include "../common/serverinfo.h"
#include "../common/zone_numbers.h"
#include "../common/moremath.h"
@ -55,6 +50,12 @@ extern volatile bool RunLoops;
#include "../common/breakdowns.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/data_verification.h"
#include "net.h"
#include "masterentity.h"
#include "worldserver.h"
#include "zonedb.h"
#include "petitions.h"
#include "forage.h"
#include "command.h"
#include "string_ids.h"
@ -594,19 +595,8 @@ bool Client::Save(uint8 iCommitNow) {
database.SaveCharacterTribute(this->CharacterID(), &m_pp);
SaveTaskState(); /* Save Character Task */
if(m_pp.hunger_level < 0) {
m_pp.hunger_level = 0;
}
else if(m_pp.hunger_level > 6000) {
m_pp.hunger_level = 6000;
}
if(m_pp.thirst_level < 0) {
m_pp.thirst_level = 0;
}
else if(m_pp.thirst_level > 6000) {
m_pp.thirst_level = 6000;
}
m_pp.hunger_level = EQEmu::Clamp(m_pp.hunger_level, 0, 50000);
m_pp.thirst_level = EQEmu::Clamp(m_pp.thirst_level, 0, 50000);
database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp, &m_epp); /* Save Character Data */
return true;