Skip to content

Commit

Permalink
Skip putting down items
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed May 9, 2024
1 parent ff316c6 commit a865698
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Fika.Core/Coop/ClientClasses/CoopClientInventoryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback
}
}

// TODO: Check for glass increments
if (operation is GClass2870)
{
return;
}

InventoryPacket packet = new()
{
HasItemControllerExecutePacket = true
Expand Down Expand Up @@ -83,6 +89,12 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback
}
}

if (operation is GClass2870)
{
base.Execute(operation, callback);
return;
}

InventoryPacket packet = new()
{
HasItemControllerExecutePacket = true
Expand All @@ -94,6 +106,7 @@ public override void Execute(GClass2837 operation, [CanBeNull] Callback callback
callback = callback,
inventoryController = this
};

clientOperationManager.callback ??= new Callback(ClientPlayer.Control0.Class1400.class1400_0.method_0);
uint operationNum = AddOperationCallback(operation, new Callback<EOperationStatus>(clientOperationManager.HandleResult));

Expand Down Expand Up @@ -153,7 +166,6 @@ private class ClientInventoryOperationManager

public void HandleResult(Result<EOperationStatus> result)
{
ConsoleScreen.Log("Running OperationManager::HandleResult");
ClientInventoryCallbackManager callbackManager = new()
{
clientOperationManager = this,
Expand Down Expand Up @@ -196,14 +208,14 @@ private class ClientInventoryCallbackManager

public void HandleResult(IResult executeResult)
{
ConsoleScreen.Log("Running CallbackManager::HandleResult");
if (!executeResult.Succeed)
{
FikaPlugin.Instance.FikaLogger.LogError($"{clientOperationManager.inventoryController.ID} - Client operation critical failure: {clientOperationManager.inventoryController.ID} - {clientOperationManager.operation}\r\nError: {executeResult.Error}");
}

clientOperationManager.operation.Dispose();
clientOperationManager.callback.Invoke(result);
return;

/*clientOperationManager.localOperationStatus = EOperationStatus.Finished;
EOperationStatus? serverOperationStatus = clientOperationManager.serverOperationStatus;
EOperationStatus? eoperationStatus = clientOperationManager.localOperationStatus;
Expand Down

0 comments on commit a865698

Please sign in to comment.