Predict general interactions. (#6856)

This commit is contained in:
Leon Friedrich
2022-03-09 20:12:17 +13:00
committed by GitHub
parent 60e7ef6073
commit 0f435f31c8
10 changed files with 283 additions and 256 deletions

View File

@@ -162,13 +162,10 @@ public abstract class SharedDoorSystem : EntitySystem
#endregion
#region Interactions
private void OnActivate(EntityUid uid, DoorComponent door, ActivateInWorldEvent args)
protected virtual void OnActivate(EntityUid uid, DoorComponent door, ActivateInWorldEvent args)
{
if (args.Handled || !door.ClickOpen)
return;
TryToggleDoor(uid, door, args.User);
args.Handled = true;
// avoid client-mispredicts, as the server will definitely handle this event
args.Handled = true;
}
private void OnExamine(EntityUid uid, DoorComponent door, ExaminedEvent args)