Enabled server broadcasting PlayerDamage events to other players to make damage indicators work

This commit is contained in:
2016-02-12 07:03:14 +01:00
parent cc422cf73a
commit bb66f95d43
6 changed files with 46 additions and 6 deletions
+4
View File
@@ -23,6 +23,10 @@ void HealthSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cHea
bool HealthSystem::OnPlayerDamaged(Events::PlayerDamage& e)
{
if (!IsServer) {
return false;
}
ComponentWrapper cHealth = e.Victim["Health"];
double& health = cHealth["Health"];
health -= e.Damage;