This commit is contained in:
aozhiwei 2019-11-22 14:31:01 +08:00
parent cd38462b94
commit 8b3590c52b
3 changed files with 0 additions and 34 deletions

View File

@ -89,12 +89,6 @@ void AndroidAI::DoMove()
for (int i = 0; i < speed; ++i) { for (int i = 0; i < speed; ++i) {
a8::Vec2 old_pos = hum->pos; a8::Vec2 old_pos = hum->pos;
hum->pos = hum->pos + hum->move_dir; hum->pos = hum->pos + hum->move_dir;
if (hum->IsCollisionInMapService()) {
hum->pos = old_pos;
if (i == 0) {
}
break;
}
hum->room->grid_service.MoveHuman(hum); hum->room->grid_service.MoveHuman(hum);
} }
} }

View File

@ -162,30 +162,6 @@ void Human::RecalcSelfCollider()
#endif #endif
} }
bool Human::IsCollisionInMapService()
{
#if 0
if (room->OverBorder(pos, meta->p->radius())){
return true;
}
std::set<ColliderComponent*> colliders;
room->map_service.GetColliders(pos.x, pos.y, colliders);
Global::last_collider = nullptr;
for (ColliderComponent* collider : colliders) {
#if 0
switch (collider->owner->entity_type) {
break;
default:
break;
}
#endif
}
#endif
return false;
}
void Human::SyncAroundPlayers(const char* file, int line, const char* func) void Human::SyncAroundPlayers(const char* file, int line, const char* func)
{ {
for (auto& cell : grid_list) { for (auto& cell : grid_list) {
@ -586,9 +562,6 @@ void Human::_UpdateMove(int speed)
for (int i = 0; i < speed; ++i) { for (int i = 0; i < speed; ++i) {
a8::Vec2 old_pos = pos; a8::Vec2 old_pos = pos;
pos = pos + move_dir; pos = pos + move_dir;
if (IsCollisionInMapService()) {
pos = old_pos;
}
room->grid_service.MoveHuman(this); room->grid_service.MoveHuman(this);
} }
} }

View File

@ -66,7 +66,6 @@ class Human : public Entity
virtual void GetAabbBox(AabbCollider& aabb_box); virtual void GetAabbBox(AabbCollider& aabb_box);
void FillMFTeamData(cs::MFTeamData* team_data); void FillMFTeamData(cs::MFTeamData* team_data);
void RecalcSelfCollider(); void RecalcSelfCollider();
bool IsCollisionInMapService();
void SyncAroundPlayers(const char* file, int line, const char* func); void SyncAroundPlayers(const char* file, int line, const char* func);
void BeKill(int killer_id, const std::string& killer_name); void BeKill(int killer_id, const std::string& killer_name);
void AddToNewObjects(Entity* entity); void AddToNewObjects(Entity* entity);