mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 07:21:51 +00:00
update player spawn point auto selection
This commit is contained in:
parent
5785060ffb
commit
f602384a94
2 changed files with 3 additions and 5 deletions
|
|
@ -105,10 +105,8 @@ void Player::postUpdate() {
|
||||||
if (flight && hitbox.grounded && !noclip) {
|
if (flight && hitbox.grounded && !noclip) {
|
||||||
flight = false;
|
flight = false;
|
||||||
}
|
}
|
||||||
if (spawnpoint.y <= 0.1) {
|
for (int i = 0; i < SPAWN_ATTEMPTS_PER_UPDATE && std::isnan(spawnpoint.x); i++) {
|
||||||
for (int i = 0; i < SPAWN_ATTEMPTS_PER_UPDATE; i++) {
|
attemptToFindSpawnpoint();
|
||||||
attemptToFindSpawnpoint();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class Player : public Serializable {
|
||||||
|
|
||||||
int chosenSlot;
|
int chosenSlot;
|
||||||
glm::vec3 position;
|
glm::vec3 position;
|
||||||
glm::vec3 spawnpoint {};
|
glm::vec3 spawnpoint {std::nanf(""), std::nanf(""), std::nanf("")};
|
||||||
std::shared_ptr<Inventory> inventory;
|
std::shared_ptr<Inventory> inventory;
|
||||||
bool suspended = false;
|
bool suspended = false;
|
||||||
bool flight = false;
|
bool flight = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue