mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41: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) {
|
||||
flight = false;
|
||||
}
|
||||
if (spawnpoint.y <= 0.1) {
|
||||
for (int i = 0; i < SPAWN_ATTEMPTS_PER_UPDATE; i++) {
|
||||
attemptToFindSpawnpoint();
|
||||
}
|
||||
for (int i = 0; i < SPAWN_ATTEMPTS_PER_UPDATE && std::isnan(spawnpoint.x); i++) {
|
||||
attemptToFindSpawnpoint();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class Player : public Serializable {
|
|||
|
||||
int chosenSlot;
|
||||
glm::vec3 position;
|
||||
glm::vec3 spawnpoint {};
|
||||
glm::vec3 spawnpoint {std::nanf(""), std::nanf(""), std::nanf("")};
|
||||
std::shared_ptr<Inventory> inventory;
|
||||
bool suspended = false;
|
||||
bool flight = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue