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 [worldserver]
NeedsSystem.MaxValue = 255
NeedsSystem.LowValue = 16 Needs.Enable = 1
NeedsSystem.CriticalValue = 5 Needs.MaxValue = 255
NeedsSystem.DropRate = 60 Needs.LowValue = 16
NeedsSystem.DropValueHunger = 1 Needs.CriticalValue = 5
NeedsSystem.DropValueThirst = 1 Needs.DropRate = 60
NeedsSystem.NewPlayerHunger = 64 Needs.DropValueHunger = 1
NeedsSystem.NewPlayerThirst = 64 Needs.DropValueThirst = 1
Needs.NewPlayerHunger = 64
Needs.NewPlayerThirst = 64

View File

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