-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31ffbf5
commit f49753e
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,16 @@ void ActorValueService::OnHealthChangeBroadcast(const PacketEvent<RequestHealthC | |
auto& message = acMessage.Packet; | ||
|
||
// TODO(cosideci): should server side health not be updated? | ||
auto actorValuesView = m_world.view<ActorValuesComponent, OwnerComponent>(); | ||
|
||
auto it = actorValuesView.find(static_cast<entt::entity>(message.Id)); | ||
|
||
if (it != actorValuesView.end()) | ||
{ | ||
auto& actorValuesComponent = actorValuesView.get<ActorValuesComponent>(*it); | ||
auto currentHealth = actorValuesComponent.CurrentActorValues.ActorValuesList[24]; | ||
actorValuesComponent.CurrentActorValues.ActorValuesList[24] = currentHealth - message.DeltaHealth; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
RobbeBryssinck
Author
Member
|
||
} | ||
|
||
NotifyHealthChangeBroadcast notify; | ||
notify.Id = message.Id; | ||
|
If the index is hardcoded, it should either be a constant kSomethingDescriptive = 24, or possibly an enum.