]> git.localhorst.tv Git - blank.git/blobdiff - src/standalone/MasterState.cpp
fixed some initialization issues
[blank.git] / src / standalone / MasterState.cpp
index 272e5a39ac2afbf1caff668d89e991b847cdaf24..635f2733fc4590317e36cd365e3ef9a2e52ce109 100644 (file)
@@ -37,6 +37,7 @@ MasterState::MasterState(
 , unload(env, world.Chunks(), save) {
        TextureIndex tex_index;
        env.loader.LoadBlockTypes("default", block_types, tex_index);
+       interface.SetInventorySlots(block_types.Size() - 1);
        chunk_renderer.LoadTextures(env.loader, tex_index);
        chunk_renderer.FogDensity(wc.fog_density);
        skeletons.Load();
@@ -84,6 +85,8 @@ void MasterState::Update(int dt) {
                hud.FocusBlock(input.BlockFocus().GetChunk(), input.BlockFocus().block);
        } else if (input.EntityFocus()) {
                hud.FocusEntity(*input.EntityFocus().entity);
+       } else {
+               hud.FocusNone();
        }
        hud.Display(block_types[player.GetInventorySlot() + 1]);
        hud.Update(dt);