[TexturePackSelectionState] World reload request added. Prevents a bug with incomplete texture packs (see #167).
parent
6202717443
commit
4337868fde
|
@ -167,7 +167,7 @@ void GameState::onEvent(const SDL_Event &event) {
|
|||
|
||||
void GameState::update() {
|
||||
m_world.checkPlayerChunk(m_player.x(), m_player.y(), m_player.z());
|
||||
m_world.update(!m_stateStack->empty() && &m_stateStack->top() == this);
|
||||
m_world.update(!m_stateStack->empty() && (&m_stateStack->top() == this || m_stateStack->top().parent() == this));
|
||||
|
||||
if (m_camera.getFieldOfView() != Config::cameraFOV)
|
||||
m_camera.setFieldOfView(Config::cameraFOV);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "GameConfig.hpp"
|
||||
#include "TextureAtlas.hpp"
|
||||
#include "TexturePackSelectionState.hpp"
|
||||
#include "World.hpp"
|
||||
|
||||
namespace fs = ghc::filesystem;
|
||||
|
||||
|
@ -61,6 +62,8 @@ TexturePackSelectionState::TexturePackSelectionState(gk::ApplicationState *paren
|
|||
auto &atlas = gk::ResourceHandler::getInstance().get<TextureAtlas>("atlas-blocks");
|
||||
atlas.clear();
|
||||
atlas.loadFromRegistry(Config::texturePack);
|
||||
|
||||
World::isReloadRequested = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue