Skip to content

Commit d9e601b

Browse files
committed
Allow the silver berry to spawn if the player saw a further screen, but did not die once
To be more consistent with golden berries. This isn't consistent with speed berries anymore, but most collabs / contests don't have speed berries anyway.
1 parent 15407cc commit d9e601b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Entities/SilverBerry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public override void Added(Scene scene) {
3838
base.Added(scene);
3939

4040
Session session = (scene as Level).Session;
41-
if (!spawnedThroughGiveSilver && (session.FurthestSeenLevel != session.Level ||
41+
if (!spawnedThroughGiveSilver && ((session.FurthestSeenLevel != session.Level && session.Deaths != 0) ||
4242
(!SaveData.Instance.CheatMode && !SaveData.Instance.Areas_Safe[session.Area.ID].Modes[(int) session.Area.Mode].Completed))) {
4343

44-
// we went in a further screen or didn't complete the level once yet: don't have the berry spawn.
44+
// we went in a further screen and die, or didn't complete the level once yet: don't have the berry spawn.
4545
RemoveSelf();
4646
}
4747
}

UI/InGameOverworldHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static class InGameOverworldHelper {
2828
.GetMethod("PlayExpandSfx", BindingFlags.NonPublic | BindingFlags.Instance);
2929

3030
private static List<Hook> altSidesHelperHooks = new List<Hook>();
31-
private static Hook hookOnMapDataLoad;
31+
private static Hook hookOnMapDataOrigLoad;
3232

3333
internal static void Load() {
3434
Everest.Events.Level.OnPause += OnPause;
@@ -48,7 +48,7 @@ internal static void Load() {
4848
On.Celeste.Player.Die += OnPlayerDie;
4949
On.Celeste.Mod.AssetReloadHelper.ReloadLevel += OnReloadLevel;
5050

51-
hookOnMapDataLoad = new Hook(
51+
hookOnMapDataOrigLoad = new Hook(
5252
typeof(MapData).GetMethod("orig_Load", BindingFlags.NonPublic | BindingFlags.Instance),
5353
typeof(InGameOverworldHelper).GetMethod("ModMapDataLoad", BindingFlags.NonPublic | BindingFlags.Static));
5454
}
@@ -90,8 +90,8 @@ internal static void Unload() {
9090
}
9191
altSidesHelperHooks.Clear();
9292

93-
hookOnMapDataLoad?.Dispose();
94-
hookOnMapDataLoad = null;
93+
hookOnMapDataOrigLoad?.Dispose();
94+
hookOnMapDataOrigLoad = null;
9595
}
9696

9797
private static void OnOuiChapterPanelStart(On.Celeste.OuiChapterPanel.orig_Start orig, OuiChapterPanel self, string checkpoint) {

0 commit comments

Comments
 (0)