From 0c167c86bc2b8566bfc5cb84331f4cf1075ddd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Sun, 20 Jun 2021 11:10:16 +0200 Subject: [PATCH] adding more checking --- sources/Parser/ParserYaml.cpp | 4 ++++ sources/System/Animation/AnimationsSystem.cpp | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/Parser/ParserYaml.cpp b/sources/Parser/ParserYaml.cpp index 24075fce..c927991c 100644 --- a/sources/Parser/ParserYaml.cpp +++ b/sources/Parser/ParserYaml.cpp @@ -197,6 +197,10 @@ namespace BBM { .addComponent(224 * (countPlayer + 1) + 200 * countPlayer, 1080 / 3, 0) .addComponent(); auto *lobby = playerLogo.addComponent(countPlayer, ready, playerTile, colors.at(colorStr)).tryGetComponent(); + std::string iaPropertyValue = node.getProperty("ia"); + if (iaPropertyValue != "false" && iaPropertyValue != "true") { + throw ParserError("Invalid value for ia property"); + } if (node.getProperty("ia") == "true") { auto *texture = dynamic_cast(ready.getComponent().drawable.get()); lobby->ready = true; diff --git a/sources/System/Animation/AnimationsSystem.cpp b/sources/System/Animation/AnimationsSystem.cpp index 5d52924b..822fa6b2 100644 --- a/sources/System/Animation/AnimationsSystem.cpp +++ b/sources/System/Animation/AnimationsSystem.cpp @@ -5,7 +5,6 @@ #include "AnimationsSystem.hpp" #include "Component/Animation/AnimationsComponent.hpp" #include "Model/Model.hpp" -#include #include "Component/Tag/TagComponent.hpp" #include "Component/Position/PositionComponent.hpp" #include "Component/Renderer/Drawable3DComponent.hpp"