[Archive] compile error to remove fatigue
[Archive] compile error to remove fatigue
Archived author: jhoancito • Posted: 2019-08-24T01:35:59+00:00
Original source
hola amigo ayúdame por favor tengo un error Tengo un parche para eliminar la fatiga del servidor Tengo un error en el Player.cpp pondré una imagen del error ayúdame por favor gracias Gracias uso la rev 61 de trinitycore
fatiga.patch
From 3da0ab4bd11ccae9d86b86a0089ec7b9d49c73d3 Mon Sep 17 00:00:00 2001
From: LordPsyan <[email protected]>
Date: Sat, 12 Nov 2011 13:41:43 -0600
Subject: [PATCH] 2011-11-12_Fatigue
---
src/server/game/Entities/Player/Player.cpp | 11 +++++++++--
src/server/worldserver/worldserver.conf.dist | 7 +++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 9b1b2c3..193ac0d 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -74,6 +74,7 @@
#include "InstanceScript.h"
#include <cmath>
#include "AccountMgr.h"
+#include "Config.h"
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -1304,9 +1305,12 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
{
switch (timer)
{
+ if(ConfigMgr::GetBoolDefault("fatigue.enabled", true)) // If "fatigue.enabled" is enabled
+ {
case FATIGUE_TIMER:
return MINUTE * IN_MILLISECONDS;
- case BREATH_TIMER:
+ }
+ case BREATH_TIMER:
{
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_DISABLE_BREATHING)))
return DISABLED_MIRROR_TIMER;
@@ -1376,6 +1380,9 @@ void Player::HandleDrowning(uint32 time_diff)
}
// In dark water
+if(ConfigMgr::GetBoolDefault("fatigue.enabled", true)) // If "fatigue.enabled" is enabled
+{
+
if (m_MirrorTimerFlags & UNDERWARER_INDARKWATER)
{
// Fatigue timer not activated - activate it
@@ -1412,7 +1419,7 @@ void Player::HandleDrowning(uint32 time_diff)
else if (m_MirrorTimerFlagsLast & UNDERWARER_INDARKWATER)
SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10);
}
-
+}
if (m_MirrorTimerFlags & (UNDERWATER_INLAVA|UNDERWATER_INSLIME))
{
// Breath timer not activated - activate it
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index a8c0d91..b28f440 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -1144,6 +1144,13 @@ InstantLogout = 1
DisableWaterBreath = 4
#
+# Enable or Disable "Fatigue" timer
+# default = 1 (enabled)
+# = 0 (disabled)
+
+fatigue.enabled = 1
+
+#
# AllFlightPaths
# Description: Character knows all flight paths (of both factions) after creation.
# Default: 0 - (Disabled)
--
Archived author: wungasaurus • Posted: 2019-08-24T07:22:24+00:00
Original source
Even though you did not show the error, probably
Switch { if { case {
should be
switch { case { if {
Quote: On 24/8/2019 at 9:22, wungasaurus said:
Even though you did not show the error, probably
Switch { if { case {
should be
switch { case { if {
Archived author: jhoancito • Posted: 2019-08-25T20:04:40+00:00
Original source
I don't understand your answer I have error installing fatigue source
Quote: On 24/8/2019 at 9:22, wungasaurus said:
Even though you did not show the error, probably
Switch { if { case {
should be
switch { case { if {
Archived author: wungasaurus • Posted: 2019-08-25T20:58:05+00:00
Original source
What is the error?
Quote: 5 hours ago, wungasaurus said:the error is player.cpp there is a photo friend
What is the error?
Archived author: jhoancito • Posted: 2019-08-26T02:55:27+00:00
Original source
Quote: 5 hours ago, wungasaurus said:the error is player.cpp there is a photo friend
What is the error?
Archived author: Gratural • Posted: 2019-08-26T07:20:51+00:00
Original source
jhoancito, your mistake - config file are readed by confmanager only one time - in world.cpp
Add in to he your additional parametet (see boolean section in World::LoadConfigSettings)
And two, are you really need set this parameter in your config if he are enabled, as i understand, always?
Archived author: wungasaurus • Posted: 2019-08-26T07:21:10+00:00
Original source
As the error says, GetBoolDefault is not a static function. You need a config Manager object there instead. I suggest you search the code for other uses of GetBoolDefault to see how.
Quote: 15 hours ago, Gratural said:
jhoancito, your mistake - config file are readed by confmanager only one time - in world.cpp
Add in to he your additional parametet (see boolean section in World::LoadConfigSettings)
And two, are you really need set this parameter in your config if he are enabled, as i understand, always?
Quote: 15 hours ago, wungasaurus said:They are going to apologize for my English. I use Google Tradutor. Thank you for answering. I took a picture of him. They told me that I have to do. Thank you
As the error says, GetBoolDefault is not a static function. You need a config Manager object there instead. I suggest you search the code for other uses of GetBoolDefault to see how.
![[Image: 1.png]](https://i.ibb.co/d6zgbSW/1.png)
Archived author: jhoancito • Posted: 2019-08-26T22:31:49+00:00
Original source
Quote: 15 hours ago, Gratural said:
jhoancito, your mistake - config file are readed by confmanager only one time - in world.cpp
Add in to he your additional parametet (see boolean section in World::LoadConfigSettings)
And two, are you really need set this parameter in your config if he are enabled, as i understand, always?
Quote: 15 hours ago, wungasaurus said:They are going to apologize for my English. I use Google Tradutor. Thank you for answering. I took a picture of him. They told me that I have to do. Thank you
As the error says, GetBoolDefault is not a static function. You need a config Manager object there instead. I suggest you search the code for other uses of GetBoolDefault to see how.
![[Image: 1.png]](https://i.ibb.co/d6zgbSW/1.png)