Skip to content

Commit

Permalink
Fix issues due to _NewTemp methods, fixes heater/cooler temperature c…
Browse files Browse the repository at this point in the history
…hanges

RW update add `_NewTemp` methods instead of replacing existing ones to keep backwards compatibility with mods. This allows mods calling those methods to work as they used to, but it causes issues with Harmony patches since those are no longer called by vanilla code. The change here is to target the `_NewTemp` methods Harmony patches (sync methods) rather than the original ones.

This should fix changing heater/cooler temperature settings as well as giving the players time to rename stillborn pawns (normally would be 1 tick in this situation).
  • Loading branch information
SokyranTheDragon committed Jun 11, 2024
1 parent 41f0131 commit 14af4ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Client/Syncing/Game/SyncDelegates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ static void SetBabyName(ChoiceLetter_BabyBirth letter)
}

// If the baby ended up being stillborn, the timer to name them is 1 tick. This patch is here to allow players in MP to actually change their name.
[MpPostfix(typeof(PregnancyUtility), nameof(PregnancyUtility.ApplyBirthOutcome))]
[MpPostfix(typeof(PregnancyUtility), nameof(PregnancyUtility.ApplyBirthOutcome_NewTemp))]
static void GiveTimeToNameStillborn(Thing __result)
{
if (Multiplayer.Client != null && __result is Pawn pawn && pawn.health.hediffSet.HasHediff(HediffDefOf.Stillborn))
Expand Down
2 changes: 1 addition & 1 deletion Source/Client/Syncing/Game/SyncMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static void Init()
SyncMethod.Register(typeof(Building_SunLamp), nameof(Building_SunLamp.MakeMatchingGrowZone));
SyncMethod.Register(typeof(Building_ShipComputerCore), nameof(Building_ShipComputerCore.TryLaunch));
SyncMethod.Register(typeof(CompPower), nameof(CompPower.TryManualReconnect));
SyncMethod.Register(typeof(CompTempControl), nameof(CompTempControl.InterfaceChangeTargetTemperature));
SyncMethod.Register(typeof(CompTempControl), nameof(CompTempControl.InterfaceChangeTargetTemperature_NewTemp));
SyncMethod.Register(typeof(CompTransporter), nameof(CompTransporter.CancelLoad), Array.Empty<SyncType>());
SyncMethod.Register(typeof(MapPortal), nameof(MapPortal.CancelLoad));
SyncMethod.Register(typeof(StorageSettings), nameof(StorageSettings.CopyFrom)).ExposeParameter(0);
Expand Down

0 comments on commit 14af4ba

Please sign in to comment.