Set outside prediction flags on system/inputs to work without prediction.

This needs to be gone through more thoroughly but it works somewhat.
This commit is contained in:
Pieter-Jan Briers
2021-12-30 03:12:04 +01:00
parent 213d0f5e33
commit a0af197259
19 changed files with 53 additions and 6 deletions

View File

@@ -41,10 +41,12 @@ namespace Content.Client.Examine
{
IoCManager.InjectDependencies(this);
UpdatesOutsidePrediction = true;
SubscribeLocalEvent<GetOtherVerbsEvent>(AddExamineVerb);
CommandBinds.Builder
.Bind(ContentKeyFunctions.ExamineEntity, new PointerInputCmdHandler(HandleExamine))
.Bind(ContentKeyFunctions.ExamineEntity, new PointerInputCmdHandler(HandleExamine, outsidePrediction: true))
.Register<ExamineSystem>();
}
@@ -72,21 +74,21 @@ namespace Content.Client.Examine
return base.CanExamine(examiner, target, predicate);
}
private bool HandleExamine(ICommonSession? session, EntityCoordinates coords, EntityUid entity)
private bool HandleExamine(in PointerInputCmdHandler.PointerInputCmdArgs args)
{
if (!entity.IsValid() || !EntityManager.EntityExists(entity))
if (!args.EntityUid.IsValid() || !EntityManager.EntityExists(args.EntityUid))
{
return false;
}
_playerEntity = _playerManager.LocalPlayer?.ControlledEntity ?? default;
if (_playerEntity == default || !CanExamine(_playerEntity, entity))
if (_playerEntity == default || !CanExamine(_playerEntity, args.EntityUid))
{
return false;
}
DoExamine(entity);
DoExamine(args.EntityUid);
return true;
}