Skip to content

Commit

Permalink
🐛 fix incorrect conditional compiling annotation
Browse files Browse the repository at this point in the history
conditional compiling annotation is not supported for class member functions, only for global functions
  • Loading branch information
Roms1383 committed Feb 1, 2024
1 parent 0775f71 commit c88a252
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions scripts/Addicted/System.reds
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,9 @@ public class AddictedSystem extends ScriptableSystem {
this.consumptions = new Consumptions();
}
this.OnPostAttach();
OnAddictedPostAttach(this);
}
@if(!ModuleExists("ModSettingsModule"))
private func OnPostAttach() -> Void {}
@if(ModuleExists("ModSettingsModule"))
private func OnPostAttach() -> Void { ModSettings.RegisterListenerToModifications(this); }
private func OnDetach() -> Void {
E(s"on detach system");
Expand All @@ -97,14 +92,9 @@ public class AddictedSystem extends ScriptableSystem {
this.ShrinkDoses();
this.OnPostDetach();
OnAddictedPostDetach(this);
}
@if(!ModuleExists("ModSettingsModule"))
private func OnPostDetach() -> Void {}
@if(ModuleExists("ModSettingsModule"))
private func OnPostDetach() -> Void { ModSettings.UnregisterListenerToModifications(this); }
private func OnRestored(saveVersion: Int32, gameVersion: Int32) -> Void {
E(s"on restored system");
Expand Down Expand Up @@ -580,4 +570,14 @@ public class AddictedSystem extends ScriptableSystem {
E(s"recalculated from timestamp \(tms)");
E(s"recalculated from gametime seconds \(gt)");
}
}
}

@if(!ModuleExists("ModSettingsModule"))
private func OnAddictedPostAttach(_: ref<AddictedSystem>) -> Void {}
@if(ModuleExists("ModSettingsModule"))
private func OnAddictedPostAttach(system: ref<AddictedSystem>) -> Void { ModSettings.RegisterListenerToModifications(system); }

@if(!ModuleExists("ModSettingsModule"))
private func OnAddictedPostDetach(_: ref<AddictedSystem>) -> Void {}
@if(ModuleExists("ModSettingsModule"))
private func OnAddictedPostDetach(system: ref<AddictedSystem>) -> Void { ModSettings.UnregisterListenerToModifications(system); }

0 comments on commit c88a252

Please sign in to comment.