修复拉回问题

This commit is contained in:
aozhiwei 2020-03-04 15:06:49 +08:00
parent dd2500029d
commit 47b73eaccb
2 changed files with 11 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#pragma once
#include "gridservice.h"
#include "room.h"
namespace cs
{
@ -49,6 +50,15 @@ class Entity
a8::Vec2 GetPos() { return pos_; };
void SetPos(a8::Vec2 pos)
{
#if 0
if (room && entity_subtype == EST_Player) {
if (room->frame_no > SERVER_FRAME_RATE * 35) {
if (pos.Distance(pos_) > 500) {
abort();
}
}
}
#endif
pos_ = pos;
}
float GetX()

View File

@ -427,6 +427,7 @@ void Human::RecalcSelfCollider()
bool Human::IsCollisionInMapService()
{
Global::last_collider = nullptr;
if (room->OverBorder(GetPos(), meta->i->radius())){
return true;
}
@ -438,7 +439,6 @@ bool Human::IsCollisionInMapService()
std::set<ColliderComponent*> colliders;
room->map_service.GetColliders(GetX(), GetY(), colliders);
Global::last_collider = nullptr;
for (ColliderComponent* collider : colliders) {
switch (collider->owner->entity_type) {
case ET_Obstacle: