New scripting features

This commit is contained in:
MihailRis
2024-01-12 12:16:54 +03:00
parent 05fe86e64c
commit faabb8178a
10 changed files with 129 additions and 43 deletions
+2 -2
View File
@@ -126,7 +126,7 @@ void WorldRenderer::drawChunks(Chunks* chunks,
}
void WorldRenderer::draw(const GfxContext& pctx, Camera* camera){
void WorldRenderer::draw(const GfxContext& pctx, Camera* camera, bool hudVisible){
EngineSettings& settings = engine->getSettings();
skybox->refresh(level->world->daytime,
1.0f+fog*2.0f, 4);
@@ -187,7 +187,7 @@ void WorldRenderer::draw(const GfxContext& pctx, Camera* camera){
drawChunks(level->chunks, camera, shader);
// Selected block
if (PlayerController::selectedBlockId != -1){
if (PlayerController::selectedBlockId != -1 && hudVisible){
blockid_t id = PlayerController::selectedBlockId;
Block* block = contentIds->getBlockDef(id);
assert(block != nullptr);