mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-05 17:42:24 +00:00
Hunger and thirst clamping within larger ranges
This commit is contained in:
parent
16c5ead887
commit
61545beff2
@ -39,15 +39,10 @@
|
|||||||
extern volatile bool RunLoops;
|
extern volatile bool RunLoops;
|
||||||
|
|
||||||
#include "../common/features.h"
|
#include "../common/features.h"
|
||||||
#include "masterentity.h"
|
|
||||||
#include "worldserver.h"
|
|
||||||
#include "../common/misc.h"
|
#include "../common/misc.h"
|
||||||
#include "zonedb.h"
|
|
||||||
#include "../common/spdat.h"
|
#include "../common/spdat.h"
|
||||||
#include "net.h"
|
|
||||||
#include "../common/packet_dump.h"
|
#include "../common/packet_dump.h"
|
||||||
#include "../common/packet_functions.h"
|
#include "../common/packet_functions.h"
|
||||||
#include "petitions.h"
|
|
||||||
#include "../common/serverinfo.h"
|
#include "../common/serverinfo.h"
|
||||||
#include "../common/zone_numbers.h"
|
#include "../common/zone_numbers.h"
|
||||||
#include "../common/moremath.h"
|
#include "../common/moremath.h"
|
||||||
@ -55,6 +50,12 @@ extern volatile bool RunLoops;
|
|||||||
#include "../common/breakdowns.h"
|
#include "../common/breakdowns.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/string_util.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 "forage.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "string_ids.h"
|
#include "string_ids.h"
|
||||||
@ -594,19 +595,8 @@ bool Client::Save(uint8 iCommitNow) {
|
|||||||
database.SaveCharacterTribute(this->CharacterID(), &m_pp);
|
database.SaveCharacterTribute(this->CharacterID(), &m_pp);
|
||||||
SaveTaskState(); /* Save Character Task */
|
SaveTaskState(); /* Save Character Task */
|
||||||
|
|
||||||
if(m_pp.hunger_level < 0) {
|
m_pp.hunger_level = EQEmu::Clamp(m_pp.hunger_level, 0, 50000);
|
||||||
m_pp.hunger_level = 0;
|
m_pp.thirst_level = EQEmu::Clamp(m_pp.thirst_level, 0, 50000);
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp, &m_epp); /* Save Character Data */
|
database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp, &m_epp); /* Save Character Data */
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user