[fix] 協成跟Hook問題

This commit is contained in:
建喵 2023-12-07 11:15:04 +08:00
parent 02e35e070e
commit 95af26c7c0

View File

@ -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<boolean>(false);
@ -149,6 +147,8 @@ const SDGame = (props: ISDGame) => {
}
function* spin(): IterableIterator<any> {
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}`);
}