Remove player health, use playermap

This commit is contained in:
Vladislav Khorev committed 2026-11-07 13:48:54 +06:00
1 parent b932a07cba
commit be8ee31f03
14 files changed
+27 -39

No files matched your search

+3 -6
View File
@@ -101,7 +101,7 @@ void InternalGameServer::startCampaign(
state_.locations.clear();
state_.players.clear();
state_.questJournal.loadFromFile(campaign.questsPath, zipFile);
state_.globalFloats["player_hp"] = 200.f;
//state_.globalFloats["player_hp"] = 200.f;
if (createLocalPlayer) {
auto player = std::make_shared<CharacterState>();
@@ -142,12 +142,12 @@ void InternalGameServer::resetCampaign(
state_.isDarklands = false;
state_.isNight = false;
state_.isDawn = false;
state_.playerHp = 200.f;
//state_.playerHp = 200.f;
state_.playerMaxHp = 200.f;
state_.money = 5500;
state_.globalInts.clear();
state_.globalFloats.clear();
state_.globalFloats["player_hp"] = 200.f;
//state_.globalFloats["player_hp"] = 200.f;
state_.tutorialStep = TutorialStep::AdvanceDialogue;
state_.tutorialPhoneChatScreenOpened = false;
state_.tutorialJournalScreenOpened = false;
@@ -271,9 +271,6 @@ void InternalGameServer::submit(const GameCommand& command)
state_.isDawn = value.dawn;
} else if constexpr (std::is_same_v<T, SetCurrentLocationCommand>) {
state_.currentLocationName = value.locationId;
} else if constexpr (std::is_same_v<T, SetPlayerHealthCommand>) {
state_.playerHp = value.hp;
state_.playerMaxHp = value.maxHp;
} else if constexpr (std::is_same_v<T, SetMoneyCommand>) {
state_.money = value.amount;
} else if constexpr (std::is_same_v<T, SpendMoneyCommand>) {