1
This commit is contained in:
parent
f354a90eca
commit
89aa344e9c
@ -39,6 +39,7 @@
|
||||
#include "skillhelper.h"
|
||||
#include "shot.h"
|
||||
#include "battledatacontext.h"
|
||||
#include "mapinstance.h"
|
||||
|
||||
const int kReviveTimeAdd = 12;
|
||||
const int kSkinNum = 4;
|
||||
@ -3531,6 +3532,31 @@ void Human::OnLand()
|
||||
if (IsPlayer()) {
|
||||
StartRefreshViewTimer();
|
||||
}
|
||||
#ifdef MAP3D
|
||||
{
|
||||
a8::Vec3 center;
|
||||
center.x = GetPos().x / 10;
|
||||
center.z = GetPos().y / 10;
|
||||
a8::Vec3 point;
|
||||
bool ok = room->map_instance->FindNearestPoint(center, 2, point);
|
||||
if (!ok) {
|
||||
abort();
|
||||
}
|
||||
a8::Vec2 new_pos;
|
||||
new_pos.x = point.x * 10;
|
||||
new_pos.y = point.z * 10;
|
||||
SetPos(new_pos);
|
||||
#ifdef DEBUG
|
||||
a8::XPrintf("OnLoad ok:%d pos:%f,%f,%f\n",
|
||||
{
|
||||
ok ? 1 : 0,
|
||||
point.x,
|
||||
point.y,
|
||||
point.z
|
||||
});
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
if (CheckCollision()) {
|
||||
a8::Vec2 old_pos = GetPos();
|
||||
std::vector<a8::Vec2> dirs;
|
||||
@ -3551,6 +3577,7 @@ void Human::OnLand()
|
||||
}
|
||||
SetPos(old_pos);
|
||||
}
|
||||
#endif
|
||||
if (IsAndroid()) {
|
||||
int buff_uniid = MustBeAddBuff(this,
|
||||
kPeaceModeBuffId
|
||||
|
@ -730,7 +730,7 @@ bool MapInstance::FindNearestPoint(const a8::Vec3& center, float radius, a8::Vec
|
||||
filter.setIncludeFlags(0xffff);
|
||||
filter.setExcludeFlags(0);
|
||||
|
||||
const float extents[3] = {2.f, 4.f, 2.f};
|
||||
const float extents[3] = {radius, radius, radius};
|
||||
float nearestPt[3];
|
||||
|
||||
float pos[3];
|
||||
@ -740,7 +740,11 @@ bool MapInstance::FindNearestPoint(const a8::Vec3& center, float radius, a8::Vec
|
||||
|
||||
navmesh_query_->findNearestPoly(pos, extents, &filter, &startRef, nearestPt);
|
||||
if (!startRef) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nearest_pt.x = nearestPt[0];
|
||||
nearest_pt.y = nearestPt[1];
|
||||
nearest_pt.z = nearestPt[2];
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user