diff --git a/packages/contracts/script/BattleConfigInit.sol b/packages/contracts/script/BattleConfigInit.sol index ba4803a2..6751b7c0 100644 --- a/packages/contracts/script/BattleConfigInit.sol +++ b/packages/contracts/script/BattleConfigInit.sol @@ -7,7 +7,7 @@ import {BattleConfig} from "../src/codegen/Tables.sol"; import { BATTLE_CONFIG_KEY } from "../src/Constants.sol"; library BattleConfigInit { - function initGameConfig(IWorld _world) internal { + function initBattleConfig(IWorld _world) internal { address[] memory players; BattleConfig.set( _world, diff --git a/packages/contracts/script/PostDeploy.s.sol b/packages/contracts/script/PostDeploy.s.sol index b2b4262a..7c61b6dd 100644 --- a/packages/contracts/script/PostDeploy.s.sol +++ b/packages/contracts/script/PostDeploy.s.sol @@ -6,6 +6,7 @@ import { console } from "forge-std/console.sol"; import { IWorld } from "../src/codegen/world/IWorld.sol"; import { GameConfigInit } from "./GameConfigInit.sol"; import { BattleConfigInit } from "./BattleConfigInit.sol"; +import { GlobalConfigInit } from "./GlobalConfigInit.sol"; import { console } from "forge-std/console.sol"; contract PostDeploy is Script { @@ -20,7 +21,8 @@ contract PostDeploy is Script { // ------------------ INIT ------------------ GameConfigInit.initGameConfig(IWorld(worldAddress)); - BattleConfigInit.initGameConfig(IWorld(worldAddress)); + BattleConfigInit.initBattleConfig(IWorld(worldAddress)); + GlobalConfigInit.initGlobalConfig(IWorld(worldAddress)); vm.stopBroadcast(); diff --git a/packages/contracts/src/systems/BattlePrepareSystem.sol b/packages/contracts/src/systems/BattlePrepareSystem.sol index 63ec628f..e8133d18 100644 --- a/packages/contracts/src/systems/BattlePrepareSystem.sol +++ b/packages/contracts/src/systems/BattlePrepareSystem.sol @@ -78,7 +78,7 @@ contract BattlePrepareSystem is System { //是否已超时 BattleListData memory battle = BattleList.get(_battleId); - BattleUtils.checkBattlePlayer(battle, _msgSender(), BattleState.Confirmed); + BattleUtils.checkBattlePlayer(battle, _msgSender(), BattleState.Inited); require(block.timestamp - battle.timestamp < BattleConfig.getMaxTimeLimit(BATTLE_CONFIG_KEY), "Battle is timeout"); // 战斗是否已经选择buff diff --git a/packages/contracts/worlds.json b/packages/contracts/worlds.json index e9146703..367411a2 100644 --- a/packages/contracts/worlds.json +++ b/packages/contracts/worlds.json @@ -1,7 +1,7 @@ { "4242": { - "address": "0x2b50622F55780b14C08a288E41A08b2e2368bA4f", - "blockNumber": 27941048 + "address": "0x037451EB237700458Af435ffF1CeFcac037247aD", + "blockNumber": 27950347 }, "31337": { "address": "0x74Df809b1dfC099E8cdBc98f6a8D1F5c2C3f66f8"