From faf591dcc6caa82102599e321f2c711bef8bbb72 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 7 May 2019 16:51:30 +0800 Subject: [PATCH] 1 --- server/gameserver/constant.h | 2 +- server/gameserver/player.cc | 7 +++---- server/gameserver/room.cc | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index 03381fb..e2898c9 100755 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -140,6 +140,6 @@ const int SMOKE_SLOT = 4; const int MAP_HEIGHT = 8192; const int MAP_WIDTH = 8192; -const int MAP_CELL_WIDTH = 64 * 5; +const int MAP_CELL_WIDTH = 64 * 8; const int DOOR_THING_ID = 61701; diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 2cfa74f..3487aa1 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -111,7 +111,6 @@ void Player::UpdateMove() moved_frames = 0; return; } - bool move_ok = false; int speed = std::max(1, (int)GetSpeed()); for (int i = 0; i < speed; ++i) { Vector2D old_pos = pos; @@ -120,7 +119,9 @@ void Player::UpdateMove() pos = old_pos; #if 1 FindPath(); - i += 1; + if (rand() % 3 == 0) { + i += 1; + } #else if (i == 0) { FindPath(); @@ -129,8 +130,6 @@ void Player::UpdateMove() #endif } move_ok = true; - } - if (move_ok) { room->grid_service.MoveHuman(this); } if (last_collision_door && !TestCollision(last_collision_door)) { diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index bf8c41f..5835530 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -23,7 +23,7 @@ #include "hero.h" const int ROOM_MAX_PLAYER_NUM = 50; -#if 0 +#if 1 const int ANDROID_NUM = 0; #else const int ANDROID_NUM = 10;