Skip to content

Commit

Permalink
Fix item duplication when canceling manual research
Browse files Browse the repository at this point in the history
  • Loading branch information
starfi5h committed Dec 22, 2021
1 parent 777bd53 commit 6a52fb3
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions NebulaPatcher/Patches/Dynamic/GameHistoryData_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,5 @@ public static bool UnlockTech_Prefix()
//Wait for the authoritative packet for unlocking tech features in multiplayer for clients
return !Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost || Multiplayer.Session.History.IsIncomingRequest;
}

[HarmonyPrefix]
[HarmonyPatch(nameof(GameHistoryData.RemoveTechInQueue))]
public static void RemoveTechInQueue_Prefix(int index, out int __state)
{
__state = GameMain.history.techQueue[index];
if (Multiplayer.IsActive && Multiplayer.Session.LocalPlayer.IsHost)
{
//we need to know which itemtypes are currently needed for refunds, so trigger refund before cancelling own research
Multiplayer.Session.Network.PlayerManager.SendTechRefundPackagesToClients(__state);
}
Log.Info($"RemoveTechInQueue: remove tech at index {index} with techId { __state}");
}
}
}

0 comments on commit 6a52fb3

Please sign in to comment.