From eab1ba7ab9f5ab1850fec0a7e421930a65bdf1ad Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 15 Mar 2024 19:40:13 -0400 Subject: [PATCH] Fix timezone variant with legendary gacha --- src/data/trainer-config.ts | 2 +- src/ui/battle-info.ts | 2 +- src/utils.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index adfffc2f9..db6d1a93a 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -11,7 +11,7 @@ import { Species } from "./enums/species"; import { tmSpecies } from "./tms"; import { Type } from "./type"; import { initTrainerTypeDialogue } from "./dialogue"; -import { PersistentModifier, TerastallizeModifier } from "../modifier/modifier"; +import { PersistentModifier } from "../modifier/modifier"; export enum TrainerPoolTier { COMMON, diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index baac2d94b..56e0cc6ff 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -359,7 +359,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container { } updateNameText(pokemon: Pokemon): void { - let displayName = pokemon.name; + let displayName = pokemon.name.replace(/[♂♀]/g, ''); let nameTextWidth: number; let nameSizeTest = addTextObject(this.scene, 0, 0, displayName, TextStyle.BATTLE_INFO); diff --git a/src/utils.ts b/src/utils.ts index f186aee98..44f6d6d27 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -87,10 +87,10 @@ export function randSeedWeightedItem(items: T[]): T { } export function getSunday(date: Date): Date { - const day = date.getDay(), - diff = date.getDate() - day; + const day = date.getDay(); + const diff = date.getDate() - day; const newDate = new Date(date.setDate(diff)); - return new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate()); + return new Date(Date.UTC(newDate.getUTCFullYear(), newDate.getUTCMonth(), newDate.getUTCDate())); } export function getFrameMs(frameCount: integer): integer {