Skip to content

Commit

Permalink
chore: optimze move function
Browse files Browse the repository at this point in the history
  • Loading branch information
xingxinglian committed Oct 16, 2023
1 parent 60ac915 commit c75fa85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/client/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_CHAIN_ID=4242
VITE_CHAIN_ID=31337
4 changes: 3 additions & 1 deletion packages/contracts/src/systems/MoveSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ contract MoveSystem is System {
uint16 x2 = i > 0 ? moveList[i - 1].x : Player.getX(_msgSender());
uint16 y2 = i > 0 ? moveList[i - 1].y : Player.getY(_msgSender());
console.log(" step : ", i, x2, y2);
console.log(" move : ", moveList[i - 1].x, moveList[i - 1].y);
if (i > 1) {
console.log(" move : ", moveList[i - 1].x, moveList[i - 1].y);
}
require(
CommonUtils.isNear(moveList[i].x, x2, moveList[i].y, y2),
"invalied move"
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/worlds.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"blockNumber": 27684685
},
"31337": {
"address": "0x22753E4264FDDc6181dc7cce468904A80a363E44"
"address": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
},
"421613": {
"address": "0x2Bc1034975c3df48D6f3026802f372677844b85d",
Expand Down

0 comments on commit c75fa85

Please sign in to comment.