From 5ba14a346aeace26efa1fa9d26841d581061066c Mon Sep 17 00:00:00 2001 From: Matthew Olker Date: Fri, 21 Jun 2024 23:11:17 -0400 Subject: [PATCH] hotfix egg source type please be the last one --- src/system/egg-data.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/system/egg-data.ts b/src/system/egg-data.ts index 1119ab4d9b8..b4bd4368bd9 100644 --- a/src/system/egg-data.ts +++ b/src/system/egg-data.ts @@ -20,7 +20,13 @@ export default class EggData { const sourceEgg = source instanceof Egg ? source as Egg : null; this.id = sourceEgg ? sourceEgg.id : source.id; this.tier = sourceEgg ? sourceEgg.tier : (source.tier ?? Math.floor(this.id / EGG_SEED)); - this.sourceType = !source.species ? source.gachaType : sourceEgg ? sourceEgg.sourceType : (source.gachaType ?? source.sourceType); + // legacy egg + if (source.species === 0) { + // check if it has a gachaType (deprecated) + this.sourceType = source.gachaType ?? source.sourceType; + } else { + this.sourceType = sourceEgg ? sourceEgg.sourceType : source.sourceType; + } this.hatchWaves = sourceEgg ? sourceEgg.hatchWaves : source.hatchWaves; this.timestamp = sourceEgg ? sourceEgg.timestamp : source.timestamp; this.variantTier = sourceEgg ? sourceEgg.variantTier : source.variantTier;