1
This commit is contained in:
parent
0119ab5556
commit
8e130a9243
@ -636,14 +636,23 @@ void Human::FindLocation()
|
||||
}
|
||||
{
|
||||
std::vector<Entity*> objects;
|
||||
int detection_flags = 0;
|
||||
{
|
||||
a8::SetBitFlag(detection_flags, ET_Obstacle);
|
||||
a8::SetBitFlag(detection_flags, ET_Player);
|
||||
for (auto& grid : grid_list) {
|
||||
for (Entity* entity : grid->entity_list) {
|
||||
switch (entity->entity_type) {
|
||||
case ET_Obstacle:
|
||||
{
|
||||
if (TestCollision(entity)){
|
||||
objects.push_back(entity);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
room->CollisionDetection(this, detection_flags, objects);
|
||||
#endif
|
||||
if (objects.empty()) {
|
||||
return;
|
||||
}
|
||||
|
@ -399,10 +399,14 @@ void Room::CreateBuilding(int thing_id, float building_x, float building_y)
|
||||
|
||||
Obstacle* Room::CreateObstacle(int id, float x, float y)
|
||||
{
|
||||
return InternalCreateObstacle(id, x, y,
|
||||
[] (Obstacle*)
|
||||
{
|
||||
});
|
||||
Obstacle* entity = InternalCreateObstacle(id, x, y,
|
||||
[] (Obstacle*)
|
||||
{
|
||||
});
|
||||
if (entity) {
|
||||
entity->BroadcastFullState();
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
void Room::CreateLoot(int equip_id, Vector2D pos, int count)
|
||||
|
Loading…
x
Reference in New Issue
Block a user