1
This commit is contained in:
parent
489f937374
commit
2e3fec2d27
@ -5,6 +5,7 @@
|
|||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "obstacle.h"
|
#include "obstacle.h"
|
||||||
#include "roomobstacle.h"
|
#include "roomobstacle.h"
|
||||||
|
#include "mapinstance.h"
|
||||||
|
|
||||||
#include "mt/AirRaid.h"
|
#include "mt/AirRaid.h"
|
||||||
#include "mt/SafeArea.h"
|
#include "mt/SafeArea.h"
|
||||||
@ -85,6 +86,24 @@ bool AirRaid::GenAirRaidPos(const mt::AirRaid* raid_meta, glm::vec3& center)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
glm::vec3 ref_point = center;
|
||||||
|
room_->map_instance->PtInHouse(center, ref_point);
|
||||||
|
room_->map_instance->Scale(ref_point);
|
||||||
|
glm::vec3 point;
|
||||||
|
bool ok = false;
|
||||||
|
for (int i = 0; i < 10; ++i) {
|
||||||
|
ok = room_->map_instance->FindNearestPoint(ref_point, 1.0f + 10 * i, point);
|
||||||
|
if (ok) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!ok) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
room_->map_instance->UnScale(point);
|
||||||
|
center = point;
|
||||||
|
}
|
||||||
room_->frame_event.AddAirRaid(raid_meta->appear_time(), center, raid_meta->rad());
|
room_->frame_event.AddAirRaid(raid_meta->appear_time(), center, raid_meta->rad());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user