refactor cfg

master
Dominik Madarász 2024-06-21 16:20:31 +02:00
parent c249498304
commit dd8c9481a5
2 changed files with 20 additions and 18 deletions

View File

@ -1,9 +1,11 @@
NeedsSystem.Enable = 1
NeedsSystem.MaxValue = 255
NeedsSystem.LowValue = 16
NeedsSystem.CriticalValue = 5
NeedsSystem.DropRate = 60
NeedsSystem.DropValueHunger = 1
NeedsSystem.DropValueThirst = 1
NeedsSystem.NewPlayerHunger = 64
NeedsSystem.NewPlayerThirst = 64
[worldserver]
Needs.Enable = 1
Needs.MaxValue = 255
Needs.LowValue = 16
Needs.CriticalValue = 5
Needs.DropRate = 60
Needs.DropValueHunger = 1
Needs.DropValueThirst = 1
Needs.NewPlayerHunger = 64
Needs.NewPlayerThirst = 64

View File

@ -49,15 +49,15 @@ public:
void OnBeforeConfigLoad(bool /* reload */) override
{
NeedsEnabled = sConfigMgr->GetOption<bool>("NeedsSystem.Enabled", true);
NeedsMaxValue = sConfigMgr->GetOption<uint8>("NeedsSystem.MaxValue", 255);
NeedsLowValue = sConfigMgr->GetOption<uint8>("NeedsSystem.LowValue", 16);
NeedsCriticalValue = sConfigMgr->GetOption<uint8>("NeedsSystem.CriticalValue", 5);
NeedsDropRate = sConfigMgr->GetOption<uint32>("NeedsSystem.DropRate", 60);
NeedsDropValueHunger = sConfigMgr->GetOption<uint8>("NeedsSystem.DropValueHunger", 1);
NeedsDropValueThirst = sConfigMgr->GetOption<uint8>("NeedsSystem.DropValueThirst", 1);
NeedsNewPlayerHunger = sConfigMgr->GetOption<uint8>("NeedsSystem.NewPlayerHunger", 64);
NeedsNewPlayerThirst = sConfigMgr->GetOption<uint8>("NeedsSystem.NewPlayerThirst", 64);
NeedsEnabled = sConfigMgr->GetOption<bool>("Needs.Enabled", true);
NeedsMaxValue = sConfigMgr->GetOption<uint8>("Needs.MaxValue", 255);
NeedsLowValue = sConfigMgr->GetOption<uint8>("Needs.LowValue", 16);
NeedsCriticalValue = sConfigMgr->GetOption<uint8>("Needs.CriticalValue", 5);
NeedsDropRate = sConfigMgr->GetOption<uint32>("Needs.DropRate", 60);
NeedsDropValueHunger = sConfigMgr->GetOption<uint8>("Needs.DropValueHunger", 1);
NeedsDropValueThirst = sConfigMgr->GetOption<uint8>("Needs.DropValueThirst", 1);
NeedsNewPlayerHunger = sConfigMgr->GetOption<uint8>("Needs.NewPlayerHunger", 64);
NeedsNewPlayerThirst = sConfigMgr->GetOption<uint8>("Needs.NewPlayerThirst", 64);
}
void OnStartup() override