diff options
| author | Mel <einebeere@gmail.com> | 2024-02-12 13:01:15 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-02-12 13:01:15 +0100 |
| commit | 6a30c3e4f22de4d0f8f32107f614f597f5f39cc1 (patch) | |
| tree | a4e45ac6c5c728266eef1b42099494854744d497 /src/World/ChunkRegistry.hpp | |
| parent | d2b5fc5b3bc648afffa42375706429685ac63794 (diff) | |
| download | meowcraft-6a30c3e4f22de4d0f8f32107f614f597f5f39cc1.tar.zst meowcraft-6a30c3e4f22de4d0f8f32107f614f597f5f39cc1.zip | |
Rescue player from void if current chunk wasn't generated prior
Diffstat (limited to 'src/World/ChunkRegistry.hpp')
| -rw-r--r-- | src/World/ChunkRegistry.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/World/ChunkRegistry.hpp b/src/World/ChunkRegistry.hpp index 2b87a3a..d583765 100644 --- a/src/World/ChunkRegistry.hpp +++ b/src/World/ChunkRegistry.hpp @@ -2,6 +2,7 @@ #include <optional> #include <unordered_map> +#include "../Time.hpp" #include "Chunk.hpp" #include "ChunkIndex.hpp" #include "Position.hpp" @@ -23,11 +24,16 @@ public: struct Data { ChunkIndex index; Status status; + Time::Tick generated_at_tick; std::optional<Chunk> chunk = {}; std::optional<GFX::Mesh> land_mesh = {}; std::optional<GFX::Mesh> water_mesh = {}; + Bool generated() const { + return chunk.has_value(); + } + Status get_status() const { if (status == Status::Done && chunk.value().is_damaged()) { return Status::Damaged; } return status; |
