Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Commit 7ffe3e1

Browse files
authored
Updated game code for new API's without View (#288)
1 parent ffc34f6 commit 7ffe3e1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

gdk.pinned

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
develop 63dd63098498785f9c565b0b3bddbc07abd4a1d0
1+
develop 9ea8fd462272a55c407bbfd23d0e94f0a8d95d9c

workers/unity/Assets/Fps/Scripts/Health/Systems/HealthRegenSystem.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ private void ProcessDamageEvents()
8383
return;
8484
}
8585

86+
var healthAuthority = GetComponentDataFromEntity<HealthComponent.HasAuthority>();
8687
for (var i = 0; i < healthModifiedEvents.Count; ++i)
8788
{
8889
ref readonly var healthEvent = ref healthModifiedEvents[i];
89-
if (componentUpdateSystem.GetAuthority(healthEvent.EntityId, HealthComponent.ComponentId) ==
90-
Authority.NotAuthoritative)
90+
var entity = workerSystem.GetEntity(healthEvent.EntityId);
91+
if (!healthAuthority.Exists(entity))
9192
{
9293
continue;
9394
}

workers/unity/Assets/Fps/Scripts/Movement/Behaviours/ProxyMovementDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private void OnClientUpdate(RotationUpdate rotation)
5353

5454
private void OnServerUpdate(ServerResponse movement)
5555
{
56-
if (server.Authority != Authority.NotAuthoritative)
56+
if (server.HasAuthority)
5757
{
5858
return;
5959
}

0 commit comments

Comments
 (0)