game2006/server/gameserver/bornpoint.cc
aozhiwei 6ed267ab5c 1
2023-05-19 16:27:25 +08:00

43 lines
908 B
C++

#include "precompile.h"
#include "bornpoint.h"
#include "room.h"
#include "mt/Map.h"
Position BornPoint::RandPoint(Room* room) const
{
Position pos;
if (wo_meta) {
pos.FromGlmVec3(wo_meta->pos);
} else {
pos.SetX(5120.000000000000);
pos.SetY(6.250846862793);
pos.SetZ(5120.000000000000);
}
if (room->IsSandTableRoom()) {
pos.SetX(60 + rand() % ((int)room->GetMapMeta()->map_width() - 100));
pos.SetY(6.250846862793);
pos.SetZ(60 + rand() % ((int)room->GetMapMeta()->map_height() - 100));
}
return pos;
}
int BornPoint::GetNum()
{
return 4;
}
Position BornPoint::GetSrcPoint(Room* room) const
{
Position pos;
if (wo_meta) {
pos.FromGlmVec3(wo_meta->pos);
} else {
pos.SetX(5120.000000000000);
pos.SetY(6.250846862793);
pos.SetZ(5120.000000000000);
}
return pos;
}