[UI] Fix candy friendship tooltip bug in Starter Select

This commit is contained in:
MokaStitcher 2024-10-11 16:33:11 +02:00
parent 4f456339f4
commit 2a2fb32a2e

View File

@ -2963,8 +2963,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.natureCursor = -1; this.natureCursor = -1;
if (this.activeTooltip === "CANDY") { if (this.activeTooltip === "CANDY") {
const { currentFriendship, friendshipCap } = this.getFriendship(this.lastSpecies.speciesId); if (this.lastSpecies) {
this.scene.ui.editTooltip("", `${currentFriendship}/${friendshipCap}`); const { currentFriendship, friendshipCap } = this.getFriendship(this.lastSpecies.speciesId);
this.scene.ui.editTooltip("", `${currentFriendship}/${friendshipCap}`);
} else {
this.scene.ui.hideTooltip();
}
} }
if (species?.forms?.find(f => f.formKey === "female")) { if (species?.forms?.find(f => f.formKey === "female")) {