From 1a429d5bfa8074aea6ce199acace47ab2a5b5f8e Mon Sep 17 00:00:00 2001 From: aLIEzsss4 Date: Wed, 13 Sep 2023 01:22:09 +0800 Subject: [PATCH] fix _getHeroIdx --- packages/contracts/src/systems/PveBotSystem.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/src/systems/PveBotSystem.sol b/packages/contracts/src/systems/PveBotSystem.sol index b3b073e..ead2d3d 100644 --- a/packages/contracts/src/systems/PveBotSystem.sol +++ b/packages/contracts/src/systems/PveBotSystem.sol @@ -19,7 +19,7 @@ contract PveBotSystem is System { function _getHeroIdx(address player) internal returns (bytes32 idx) { uint32 i = Player.getHeroOrderIdx(player); - idx = bytes32(uint256((uint160(player) << 32) + ++i)); + idx = bytes32((uint256(uint160(player)) << 96) + ++i); Player.setHeroOrderIdx(player, i); }