修复宕机问题
This commit is contained in:
parent
a5da82bb6e
commit
b0d3bd8feb
@ -31,6 +31,8 @@
|
|||||||
#include "framework/cpp/tglog.h"
|
#include "framework/cpp/tglog.h"
|
||||||
#include "framework/cpp/httpclientpool.h"
|
#include "framework/cpp/httpclientpool.h"
|
||||||
|
|
||||||
|
#include "collider.h"
|
||||||
|
|
||||||
struct MsgNode
|
struct MsgNode
|
||||||
{
|
{
|
||||||
SocketFrom_e sockfrom;
|
SocketFrom_e sockfrom;
|
||||||
@ -92,6 +94,15 @@ static void SavePerfLog()
|
|||||||
|
|
||||||
bool App::Init(int argc, char* argv[])
|
bool App::Init(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
{
|
||||||
|
AabbCollider a_collider;
|
||||||
|
AabbCollider b_collider;
|
||||||
|
a8::Vec2 new_pos;
|
||||||
|
bool ret = a_collider.CalcSafePoint(&b_collider, new_pos);
|
||||||
|
int i = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
this->argc = argc;
|
this->argc = argc;
|
||||||
this->argv = argv;
|
this->argv = argv;
|
||||||
|
@ -2320,8 +2320,12 @@ void Creature::FindLocationWithTarget(Entity* target, ColliderComponent* target_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a8::Vec2 new_pos_dir = new_pos - old_pos;
|
a8::Vec2 new_pos_dir = a8::Vec2::UP;
|
||||||
new_pos_dir.Normalize();
|
//特殊情况处理
|
||||||
|
if (new_pos.ManhattanDistance(old_pos) > 0.0001f) {
|
||||||
|
new_pos_dir = new_pos - old_pos;
|
||||||
|
new_pos_dir.Normalize();
|
||||||
|
}
|
||||||
float distance = (new_pos - old_pos).Norm();
|
float distance = (new_pos - old_pos).Norm();
|
||||||
for (int i = distance; i < 10000000; i += 5) {
|
for (int i = distance; i < 10000000; i += 5) {
|
||||||
SetPos(old_pos + new_pos_dir * i);
|
SetPos(old_pos + new_pos_dir * i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user