Commit 7fcc5c00 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'fix/reload' into 'main'

fix reload

See merge request !149
parents 0eb554ec 9549cfbe
Pipeline #20853 passed with stages
in 18 minutes and 41 seconds
......@@ -72,7 +72,7 @@ export const updateFieldDataImpl: DuelReducer<MsgUpdateData> = (
const zone = action.payload.zone;
const actions = action.payload.actions;
if (player && zone && actions) {
if (player !== undefined && zone !== undefined && actions !== undefined) {
switch (zone) {
case ygopro.CardZone.HAND: {
const hand = judgeSelf(player, state) ? state.meHands : state.opHands;
......
......@@ -15,10 +15,10 @@ export function judgeSelf(player: number, state: Draft<DuelState>): boolean {
const selfType = state.selfType;
if (selfType === 1) {
// 自己是先攻
return player === 0;
return player == 0;
} else if (selfType === 2) {
// 自己是后攻
return player === 1;
return player == 1;
} else {
// currently never reach
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment