This commit is contained in:
aozhiwei 2022-12-26 18:51:52 +08:00
parent c906259fcd
commit 59cd808434

View File

@ -5,6 +5,7 @@
#include "incubator.h"
#include "roomobstacle.h"
#include "gridservice.h"
#include "glmhelper.h"
#include "pvedata.h"
@ -140,14 +141,11 @@ void PveData::FlyDoor(Room* room, glm::vec3& point, int radius)
(
[room, &point, radius] (Human* hum)
{
a8::Vec2 dir = a8::Vec2::UP;
dir.Rotate(a8::RandAngle());
hum->GetMutablePos().FromGlmVec3(point);
#if 1
#else
a8::Vec2 new_pos = point + dir * a8::RandEx(1, radius);
hum->SetPos(new_pos);
#endif
glm::vec3 dir = GlmHelper::UP;
GlmHelper::RotateY(dir, a8::RandAngle());
glm::vec3 new_pos = point + dir * (float)a8::RandEx(1, radius);
hum->GetMutablePos().FromGlmVec3(new_pos);
//hum->TryAddBuff(hum, 1025);
room->grid_service->MoveCreature(hum);
return true;