entity.Bounds({ { -0.5f, -0.5f, -0.5f }, { 0.5f, 0.5f, 0.5f } });
entity.WorldCollidable(true);
entity.Position(config.spawn);
entity.Bounds({ { -0.5f, -0.5f, -0.5f }, { 0.5f, 0.5f, 0.5f } });
entity.WorldCollidable(true);
entity.Position(config.spawn);
- ChunkIndex *index = &chunks.MakeIndex(entity.ChunkCoords(), 6);
- players.emplace_back(&entity, index);
- return players.back();
+ ChunkIndex &index = chunks.MakeIndex(entity.ChunkCoords(), 6);
+ players.emplace_back(entity, index);
+ return &players.back();
}
entity->Name(name);
// TODO: load from save file here
entity->Bounds({ { -0.5f, -0.5f, -0.5f }, { 0.5f, 0.5f, 0.5f } });
entity->WorldCollidable(true);
entity->Position(config.spawn);
}
entity->Name(name);
// TODO: load from save file here
entity->Bounds({ { -0.5f, -0.5f, -0.5f }, { 0.5f, 0.5f, 0.5f } });
entity->WorldCollidable(true);
entity->Position(config.spawn);
- ChunkIndex *index = &chunks.MakeIndex(entity->ChunkCoords(), 6);
- players.emplace_back(entity, index);
- return players.back();
+ ChunkIndex &index = chunks.MakeIndex(entity->ChunkCoords(), 6);
+ players.emplace_back(*entity, index);
+ return &players.back();
World::EntityHandle World::RemoveEntity(EntityHandle &eh) {
// check for player
for (auto player = players.begin(), end = players.end(); player != end;) {
World::EntityHandle World::RemoveEntity(EntityHandle &eh) {
// check for player
for (auto player = players.begin(), end = players.end(); player != end;) {