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

+14 -2
View File
@@ -165,11 +165,23 @@ namespace FRG
gameServer_.submit(
TryCharacterAttackComboCommand{locationId_, character.entityId()});
}
void Location::setCharacterHp(Character& character, float hp)
{
gameServer_.submit(
SetCharacterHealthCommand{locationId_, character.entityId(), hp});
SetCharacterHealthCommand{ locationId_, character.entityId(), hp });
auto state = character.stateSnapshot();
if (character.onHpChanged && state)
character.onHpChanged(
state->hp,
state->initialHp,
std::string());
}
void Location::refillCharacterHp(Character& character)
{
gameServer_.submit(
SetCharacterHealthCommand{locationId_, character.entityId(), character.stateSnapshot()->initialHp});
auto state = character.stateSnapshot();
if (character.onHpChanged && state)
character.onHpChanged(