From 4795c5748829df38dbf380cbe6bf9c184dc05826 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Wed, 13 Sep 2023 14:15:27 -0300 Subject: [PATCH 1/5] Update config.lua.dist --- config.lua.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/config.lua.dist b/config.lua.dist index c6b37bb9a03..729da089b30 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -327,6 +327,7 @@ resetSessionsOnStartup = false -- Misc. -- NOTE: experienceDisplayRates: set to false to ignore exp rate or true to include exp rate allowChangeOutfit = true +enableMountInPZ = false freePremium = false kickIdlePlayerAfterMinutes = 15 maxMessageBuffer = 4 From 0dfc3c8cd6c02c4700785ad3c6cf2b6543dea535 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Wed, 13 Sep 2023 14:42:45 -0300 Subject: [PATCH 2/5] Update config_definitions.hpp --- src/config/config_definitions.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config/config_definitions.hpp b/src/config/config_definitions.hpp index 98f72a90be1..8bebedb3705 100644 --- a/src/config/config_definitions.hpp +++ b/src/config/config_definitions.hpp @@ -88,6 +88,7 @@ enum booleanConfig_t { VIP_STAY_ONLINE, REWARD_CHEST_COLLECT_ENABLED, + ENABLE_MOUNT_IN_PZ, LAST_BOOLEAN_CONFIG }; From 6411504e9d6ab3913cc33b0fb22e72d8f047565a Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Wed, 13 Sep 2023 14:45:34 -0300 Subject: [PATCH 3/5] Update configmanager.cpp --- src/config/configmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index 6f04e53201b..a3f49b5cb3a 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -389,6 +389,8 @@ bool ConfigManager::load() { boolean[REWARD_CHEST_COLLECT_ENABLED] = getGlobalBoolean(L, "rewardChestCollectEnabled", true); integer[REWARD_CHEST_MAX_COLLECT_ITEMS] = getGlobalNumber(L, "rewardChestMaxCollectItems", 200); + boolean[ENABLE_MOUNT_IN_PZ] = getGlobalBoolean(L, "enableMountInPZ", false); + loaded = true; lua_close(L); return true; From 1ba068c833829eadf7394c450a501ad897861cfc Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Wed, 13 Sep 2023 15:15:17 -0300 Subject: [PATCH 4/5] Update player.cpp --- src/creatures/players/player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index b018a9d5e25..5594955f8c4 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1693,7 +1693,7 @@ void Player::onChangeZone(ZoneType_t zone) { onAttackedCreatureDisappear(false); } - if (!group->access && isMounted()) { + if (!g_configManager().getBoolean(ENABLE_MOUNT_IN_PZ) && !group->access && isMounted()) { dismount(); g_game().internalCreatureChangeOutfit(this, defaultOutfit); wasMounted = true; @@ -5631,7 +5631,7 @@ bool Player::toggleMount(bool mount) { return false; } - if (!group->access && tile->hasFlag(TILESTATE_PROTECTIONZONE)) { + if (!g_configManager().getBoolean(ENABLE_MOUNT_IN_PZ) && !group->access && tile->hasFlag(TILESTATE_PROTECTIONZONE)) { sendCancelMessage(RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE); return false; } From 3537fd0657d9d3b798a39c31804c3b87b655edd4 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Fri, 22 Sep 2023 20:20:36 -0300 Subject: [PATCH 5/5] fix: review duuh --- config.lua.dist | 2 +- src/config/config_definitions.hpp | 2 +- src/config/configmanager.cpp | 2 +- src/creatures/players/player.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.lua.dist b/config.lua.dist index 729da089b30..5d69ecd6fef 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -327,7 +327,7 @@ resetSessionsOnStartup = false -- Misc. -- NOTE: experienceDisplayRates: set to false to ignore exp rate or true to include exp rate allowChangeOutfit = true -enableMountInPZ = false +toggleMountInProtectionZone = false freePremium = false kickIdlePlayerAfterMinutes = 15 maxMessageBuffer = 4 diff --git a/src/config/config_definitions.hpp b/src/config/config_definitions.hpp index 8bebedb3705..020e8579664 100644 --- a/src/config/config_definitions.hpp +++ b/src/config/config_definitions.hpp @@ -88,7 +88,7 @@ enum booleanConfig_t { VIP_STAY_ONLINE, REWARD_CHEST_COLLECT_ENABLED, - ENABLE_MOUNT_IN_PZ, + TOGGLE_MOUNT_IN_PZ, LAST_BOOLEAN_CONFIG }; diff --git a/src/config/configmanager.cpp b/src/config/configmanager.cpp index a3f49b5cb3a..7776bb519c2 100644 --- a/src/config/configmanager.cpp +++ b/src/config/configmanager.cpp @@ -389,7 +389,7 @@ bool ConfigManager::load() { boolean[REWARD_CHEST_COLLECT_ENABLED] = getGlobalBoolean(L, "rewardChestCollectEnabled", true); integer[REWARD_CHEST_MAX_COLLECT_ITEMS] = getGlobalNumber(L, "rewardChestMaxCollectItems", 200); - boolean[ENABLE_MOUNT_IN_PZ] = getGlobalBoolean(L, "enableMountInPZ", false); + boolean[TOGGLE_MOUNT_IN_PZ] = getGlobalBoolean(L, "toggleMountInProtectionZone", false); loaded = true; lua_close(L); diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 099e333136e..98dd5a3f2ed 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -1690,7 +1690,7 @@ void Player::onChangeZone(ZoneType_t zone) { onAttackedCreatureDisappear(false); } - if (!g_configManager().getBoolean(ENABLE_MOUNT_IN_PZ) && !group->access && isMounted()) { + if (!g_configManager().getBoolean(TOGGLE_MOUNT_IN_PZ) && !group->access && isMounted()) { dismount(); g_game().internalCreatureChangeOutfit(this, defaultOutfit); wasMounted = true; @@ -5628,7 +5628,7 @@ bool Player::toggleMount(bool mount) { return false; } - if (!g_configManager().getBoolean(ENABLE_MOUNT_IN_PZ) && !group->access && tile->hasFlag(TILESTATE_PROTECTIONZONE)) { + if (!g_configManager().getBoolean(TOGGLE_MOUNT_IN_PZ) && !group->access && tile->hasFlag(TILESTATE_PROTECTIONZONE)) { sendCancelMessage(RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE); return false; }