Fix more errors, client and server now build

This commit is contained in:
DrSmugleaf
2021-12-06 14:00:39 +01:00
parent 525297c5fe
commit af4eb3c7cd
32 changed files with 94 additions and 97 deletions

View File

@@ -84,7 +84,7 @@ namespace Content.Client.Actions
return new((in PointerInputCmdHandler.PointerInputCmdArgs args) =>
{
var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
if (playerEntity == default ||
if (playerEntity == null ||
!EntityManager.TryGetComponent<ClientActionsComponent?>(playerEntity.Value, out var actionsComponent)) return false;
actionsComponent.HandleHotbarKeybind(slot, args);
@@ -98,8 +98,7 @@ namespace Content.Client.Actions
return new((in PointerInputCmdHandler.PointerInputCmdArgs args) =>
{
var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
if (playerEntity == default ||
!EntityManager.TryGetComponent<ClientActionsComponent?>(playerEntity.Value, out var actionsComponent)) return false;
if (!EntityManager.TryGetComponent<ClientActionsComponent?>(playerEntity, out var actionsComponent)) return false;
actionsComponent.HandleChangeHotbarKeybind(hotbar, args);
return true;
@@ -110,8 +109,7 @@ namespace Content.Client.Actions
private bool TargetingOnUse(in PointerInputCmdHandler.PointerInputCmdArgs args)
{
var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
if (playerEntity == default ||
!EntityManager.TryGetComponent<ClientActionsComponent?>(playerEntity.Value, out var actionsComponent)) return false;
if (!EntityManager.TryGetComponent<ClientActionsComponent?>(playerEntity, out var actionsComponent)) return false;
return actionsComponent.TargetingOnUse(args);
}
@@ -119,8 +117,7 @@ namespace Content.Client.Actions
private void ToggleActionsMenu()
{
var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
if (playerEntity == default ||
!EntityManager.TryGetComponent<ClientActionsComponent?>(playerEntity.Value, out var actionsComponent)) return;
if (!EntityManager.TryGetComponent<ClientActionsComponent?>(playerEntity, out var actionsComponent)) return;
actionsComponent.ToggleActionsMenu();
}