mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-31 01:25:21 +00:00
fixed another possible issue
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <Component/Gamepad/GamepadComponent.hpp>
|
||||
#include <Component/Renderer/Drawable2DComponent.hpp>
|
||||
#include <System/Lobby/LobbySystem.hpp>
|
||||
#include <filesystem>
|
||||
|
||||
namespace RAY3D = RAY::Drawables::Drawables3D;
|
||||
namespace RAY2D = RAY::Drawables::Drawables2D;
|
||||
@@ -178,6 +179,11 @@ namespace BBM {
|
||||
playerName.push_back(name);
|
||||
}
|
||||
}
|
||||
if ((tmpAssets.find("red.png") == std::string::npos && tmpAssets.find("blue.png") == std::string::npos &&
|
||||
tmpAssets.find("green.png") == std::string::npos && tmpAssets.find("yellow.png") == std::string::npos &&
|
||||
tmpAssets.find("ai.png") == std::string::npos) || !std::filesystem::exists(tmpAssets)) {
|
||||
throw (ParserError("Error with saved map: One asset is invalid.\n Loading default maps..."));
|
||||
}
|
||||
auto resumeScene = Runner::gameState._loadedScenes[GameState::SceneID::ResumeLobbyScene];
|
||||
auto &playerTile = resumeScene->addEntity("player tile")
|
||||
.addComponent<PositionComponent>(224 * (countPlayer + 1) + 200 * countPlayer, 1080 / 3, 0)
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace BBM
|
||||
try {
|
||||
ParserYAML::load(scene);
|
||||
} catch (std::exception const &err) {
|
||||
scene->addEntity("Error message parser")
|
||||
Runner::gameState._loadedScenes[GameState::SceneID::LobbyScene]->addEntity("Error message parser")
|
||||
.addComponent<PositionComponent>(1920 / 5, 2 * 1080 / 4.25, 0)
|
||||
.addComponent<Drawable2DComponent, RAY2D::Text>(err.what(), 50, RAY::Vector2(), RED)
|
||||
.addComponent<TimerComponent>(3s, [](WAL::Entity &entity, WAL::Wal &wal) {
|
||||
|
||||
Reference in New Issue
Block a user