From ba0ec9b5f5ec6b7abfce60bf37ab3b3873e91ed5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 22 Nov 2019 13:51:42 +0800 Subject: [PATCH] 1 --- server/gameserver/android.ai.cc | 2 -- server/gameserver/human.cc | 1 - server/gameserver/human.h | 1 - server/gameserver/room.cc | 5 ----- 4 files changed, 9 deletions(-) diff --git a/server/gameserver/android.ai.cc b/server/gameserver/android.ai.cc index 420ea49..e60b44f 100644 --- a/server/gameserver/android.ai.cc +++ b/server/gameserver/android.ai.cc @@ -73,7 +73,6 @@ void AndroidAI::ChangeToState(AndroidState_e to_state) hum->move_dir = a8::Vec2(1.0f, 0); hum->move_dir.Rotate(a8::RandAngle()); hum->move_dir.Normalize(); - hum->attack_dir = hum->move_dir; } break; default: @@ -116,7 +115,6 @@ void AndroidAI::DoAttack() std::abs(shot_dir.y) > FLT_EPSILON) { shot_dir.Normalize(); shot_dir.Rotate((rand() % 10) / 180.0f); - sender->attack_dir = shot_dir; } } } diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 5b1c2c4..40fda39 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -153,7 +153,6 @@ void Human::FillMFTeamData(cs::MFTeamData* team_data) team_data->set_player_id(entity_uniid); team_data->set_name(name); TypeConvert::ToPb(pos, team_data->mutable_pos()); - TypeConvert::ToPb(attack_dir, team_data->mutable_dir()); team_data->set_disconnected(false); team_data->set_dead(dead); } diff --git a/server/gameserver/human.h b/server/gameserver/human.h index f70be55..149119a 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -36,7 +36,6 @@ class Human : public Entity HumanAbility buff; a8::Vec2 move_dir; - a8::Vec2 attack_dir; std::string name; std::string avatar_url; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index f13fa68..f944674 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -149,11 +149,6 @@ int Room::AliveCount() void Room::AddPlayer(Player* hum) { assert(gas_data.gas_mode == GasInactive); - hum->attack_dir = hum->pos; - hum->attack_dir.Normalize(); - hum->attack_dir.Rotate(a8::RandAngle()); - hum->move_dir = hum->attack_dir; - hum->entity_uniid = AllocUniid(); hum->room = this; hum->join_frameno = frame_no;