修复拉回问题
This commit is contained in:
parent
dd2500029d
commit
47b73eaccb
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "gridservice.h"
|
#include "gridservice.h"
|
||||||
|
#include "room.h"
|
||||||
|
|
||||||
namespace cs
|
namespace cs
|
||||||
{
|
{
|
||||||
@ -49,6 +50,15 @@ class Entity
|
|||||||
a8::Vec2 GetPos() { return pos_; };
|
a8::Vec2 GetPos() { return pos_; };
|
||||||
void SetPos(a8::Vec2 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;
|
pos_ = pos;
|
||||||
}
|
}
|
||||||
float GetX()
|
float GetX()
|
||||||
|
@ -427,6 +427,7 @@ void Human::RecalcSelfCollider()
|
|||||||
|
|
||||||
bool Human::IsCollisionInMapService()
|
bool Human::IsCollisionInMapService()
|
||||||
{
|
{
|
||||||
|
Global::last_collider = nullptr;
|
||||||
if (room->OverBorder(GetPos(), meta->i->radius())){
|
if (room->OverBorder(GetPos(), meta->i->radius())){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -438,7 +439,6 @@ bool Human::IsCollisionInMapService()
|
|||||||
std::set<ColliderComponent*> colliders;
|
std::set<ColliderComponent*> colliders;
|
||||||
room->map_service.GetColliders(GetX(), GetY(), colliders);
|
room->map_service.GetColliders(GetX(), GetY(), colliders);
|
||||||
|
|
||||||
Global::last_collider = nullptr;
|
|
||||||
for (ColliderComponent* collider : colliders) {
|
for (ColliderComponent* collider : colliders) {
|
||||||
switch (collider->owner->entity_type) {
|
switch (collider->owner->entity_type) {
|
||||||
case ET_Obstacle:
|
case ET_Obstacle:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user