diff --git a/src/UI/Lobby/SDGame.tsx b/src/UI/Lobby/SDGame.tsx index eafc821..4543410 100644 --- a/src/UI/Lobby/SDGame.tsx +++ b/src/UI/Lobby/SDGame.tsx @@ -7,7 +7,7 @@ import { NetManagerSD } from "@/Engine/CatanEngine/NetManagerV2/NetManagerSD"; import CSSettingsSDV3 from "@/FormTableSD/CSSettingsSDV3"; import { SlotsetTableRow } from "@/FormTableSD/Tables/SlotsetTable"; import A from "@/components/CustomA"; -import { useGameItems } from "@/context/GameItemsContext"; +import { gameObj, useGameItems } from "@/context/GameItemsContext"; import { SDAccountLoginRequest } from "@/define/Request/AccountRequest"; import { SlotInRequest } from "@/define/Request/SlotRequest"; import GameManager from "@/modules/GameManager"; @@ -18,9 +18,7 @@ import { ChangeEvent, useEffect, useState } from "react"; const SDGame = (props: ISDGame) => { const { gameUrl, onClickSlotOut } = props; - const { player, setPlayer } = useGameItems(); const { gameData } = useGameItems(); - const { m: money } = player; const { nowSlotId } = gameData; const [, setRender] = useState(0); const [isOK, setIsOK] = useState(false); @@ -149,6 +147,8 @@ const SDGame = (props: ISDGame) => { } function* spin(): IterableIterator { + const { player } = gameObj; + const { m: money } = player; if (money < GameManager.SlotData.NowBet) { noMoney(); OnClickStop(); @@ -173,6 +173,8 @@ const SDGame = (props: ISDGame) => { } function noMoney(): void { + const { player } = gameObj; + const { m: money } = player; GameManager.SlotData.IsSpin = false; AddLog(`金額不足: ${money}`); }