mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add player.is_suspended, player.set_suspended
This commit is contained in:
parent
40cdebb175
commit
43f0cbe3fe
6 changed files with 59 additions and 0 deletions
|
|
@ -66,6 +66,9 @@ LevelController::LevelController(
|
|||
|
||||
void LevelController::update(float delta, bool pause) {
|
||||
for (const auto& [_, player] : *level->players) {
|
||||
if (player->isSuspended()) {
|
||||
continue;
|
||||
}
|
||||
glm::vec3 position = player->getPosition();
|
||||
player->chunks->configure(
|
||||
position.x,
|
||||
|
|
@ -85,6 +88,9 @@ void LevelController::update(float delta, bool pause) {
|
|||
level->entities->updatePhysics(delta);
|
||||
level->entities->update(delta);
|
||||
for (const auto& [_, player] : *level->players) {
|
||||
if (player->isSuspended()) {
|
||||
continue;
|
||||
}
|
||||
if (playerTickClock.update(delta)) {
|
||||
if (player->getId() % playerTickClock.getParts() ==
|
||||
playerTickClock.getPart()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue