mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
move Chunks from Level to Player
This commit is contained in:
parent
b7664b4188
commit
1c18c02092
40 changed files with 450 additions and 220 deletions
|
|
@ -205,12 +205,12 @@ void Player::attemptToFindSpawnpoint() {
|
|||
position.z + (rand() % 200 - 100)
|
||||
);
|
||||
while (newpos.y > 0 &&
|
||||
!level->chunks->isObstacleBlock(newpos.x, newpos.y - 2, newpos.z)) {
|
||||
!chunks->isObstacleBlock(newpos.x, newpos.y - 2, newpos.z)) {
|
||||
newpos.y--;
|
||||
}
|
||||
|
||||
voxel* headvox = level->chunks->get(newpos.x, newpos.y + 1, newpos.z);
|
||||
if (level->chunks->isObstacleBlock(newpos.x, newpos.y, newpos.z) ||
|
||||
voxel* headvox = chunks->get(newpos.x, newpos.y + 1, newpos.z);
|
||||
if (chunks->isObstacleBlock(newpos.x, newpos.y, newpos.z) ||
|
||||
headvox == nullptr || headvox->id != 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue