From 1bbb6cced76b8cda8a2fe8ea186f6773f0a1fbc0 Mon Sep 17 00:00:00 2001 From: Sanbao Zheng Date: Wed, 5 Jul 2023 11:15:49 +0800 Subject: [PATCH] fix reset piece coord --- packages/contracts/src/systems/AutoBattleSystem.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/src/systems/AutoBattleSystem.sol b/packages/contracts/src/systems/AutoBattleSystem.sol index 034c01f..c579a5e 100644 --- a/packages/contracts/src/systems/AutoBattleSystem.sol +++ b/packages/contracts/src/systems/AutoBattleSystem.sol @@ -517,7 +517,7 @@ contract AutoBattleSystem is System { PieceData memory piece = Piece.get(pieceId); uint256 health = piece.tier > 0 ? Creatures.getHealth(piece.creature)*CreatureConfig.getItemHealthAmplifier(piece.tier-1)/100 : Creatures.getHealth(piece.creature); PieceInBattle.setCurHealth(id, uint32(health)); - PieceInBattle.setX(id, i > num1 ? uint32(mapLength) - 1 - piece.x : piece.x); + PieceInBattle.setX(id, i < num1 ? piece.x : uint32(mapLength) - 1 - piece.x); PieceInBattle.setY(id, piece.y); } }