Skip to content

Commit

Permalink
Remove redundant new EventData<Contract>.OnEvent() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Apr 8, 2023
1 parent b800a75 commit ad6ff4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TestFlightContracts/TestFlightContractConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ protected override void OnParameterLoad(ConfigNode node)
protected override void OnRegister()
{
base.OnRegister();
GameEvents.Contract.onAccepted.Add(new EventData<Contract>.OnEvent(OnContractAccepted));
GameEvents.Contract.onAccepted.Add(OnContractAccepted);
}

protected override void OnUnregister()
{
base.OnUnregister();
GameEvents.Contract.onAccepted.Remove(new EventData<Contract>.OnEvent(OnContractAccepted));
GameEvents.Contract.onAccepted.Remove(OnContractAccepted);
}

protected void OnContractAccepted(Contract contract)
Expand Down
4 changes: 3 additions & 1 deletion TestFlightCore/TestFlightCore/TestFlightRnD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ namespace TestFlightCore
public class TestFlightRnD : MonoBehaviour
{
Dictionary<string, int> baseCost = null;

public void Start()
{
RDController.OnRDTreeSpawn.Add(new EventData<RDController>.OnEvent(OnTreeSpawn));
RDController.OnRDTreeSpawn.Add(OnTreeSpawn);
DontDestroyOnLoad(this);
}

public void OnTreeSpawn(RDController controller)
{
if (TestFlightManagerScenario.Instance == null || controller.nodes == null)
Expand Down

0 comments on commit ad6ff4c

Please sign in to comment.