Skip to content

Commit

Permalink
CLIENT-GAME: Fix redsource on windows (#144)
Browse files Browse the repository at this point in the history
* CLIENT-GAME: Fix redsource on windows

* FORMAT-AUTO: automatic format on pull request #144

* CLIENT: Remove logger fatal wtf

* FORMAT-AUTO: automatic format on pull request #144

---------

Co-authored-by: Github Actions <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Saverio976 and github-actions[bot] authored Nov 22, 2023
1 parent 42ba99f commit 57648c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 3 additions & 5 deletions src/Client/Systems/Menus/Menu/MenuSystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,13 @@ namespace Systems {
}
Registry::getInstance().getClock().restart(clockId);
switch (Scene::SceneManager::getInstance().getCurrentScene()) {
case MENU: Logger::fatal("in menu"); Scene::SceneManager::getInstance().stop(); break;
case MENU: Scene::SceneManager::getInstance().stop(); break;
case CREATE_LOBBY_SCENE:
Logger::fatal("in select create lobby");
Scene::SceneManager::getInstance().changeScene(SELECT_LOBBY);
break;
case SELECT_LOBBY: Logger::fatal("in select lobby"); Scene::SceneManager::getInstance().changeScene(MENU); break;
case CREATE_SERVER_SCENE: Logger::fatal("in create server"); Scene::SceneManager::getInstance().changeScene(MENU); break;
case SELECT_LOBBY: Scene::SceneManager::getInstance().changeScene(MENU); break;
case CREATE_SERVER_SCENE: Scene::SceneManager::getInstance().changeScene(MENU); break;
case GAME:
Logger::fatal("in game");
Nitwork::NitworkClient::getInstance().disconnectLobby();
Types::WaveInfos::getInstance().reset();
Scene::SceneManager::getInstance().changeScene(SELECT_LOBBY);
Expand Down
16 changes: 13 additions & 3 deletions src/Game/ResourcesManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,13 @@ class ResourcesManager {

if (!ResourcesManager::isExists(path_tmp.string(), "share")
|| !ResourcesManager::isExists(path_tmp.string(), "bin")) {
Logger::fatal("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string());
return ResourcesManager::getRessourcePathNormal(pathFolderInit);
Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string());
path_tmp = path_tmp.parent_path();
if (!ResourcesManager::isExists(path_tmp.string(), "share")
|| !ResourcesManager::isExists(path_tmp.string(), "bin")) {
Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string());
return ResourcesManager::getRessourcePathNormal(pathFolderInit);
}
}
return path_tmp.string();
}
Expand All @@ -196,7 +201,12 @@ class ResourcesManager {
boost::filesystem::path path_tmp = pathFolderInit;

if (!ResourcesManager::isExists(path_tmp.string(), "assets")) {
Logger::fatal("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string());
Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string());
path_tmp = path_tmp.parent_path();
if (!ResourcesManager::isExists(path_tmp.string(), "assets")) {
Logger::warn("RESOURCE_MANAGER: Path don't contain OK: " + path_tmp.string());
return "";
}
return "";
}
return path_tmp.string();
Expand Down

0 comments on commit 57648c5

Please sign in to comment.