fixing compil warning

This commit is contained in:
Clément Le Bihan
2021-06-20 12:20:12 +02:00
parent 51b13bc9e0
commit a324d70dcc
@@ -7,15 +7,23 @@
#include <filesystem>
#include "Map/MapInfo.hpp"
#include "Exception/Error.hpp"
#include "Component/IAControllable/IAControllableComponent.hpp"
namespace BBM
{
IAControllableComponent::IAControllableComponent(WAL::Entity &entity, std::string scriptPath)
: Component(entity), _scriptPath(scriptPath), _state(), registered(false)
: Component(entity),
_scriptPath(scriptPath),
registered(false),
_state()
{
if (std::filesystem::exists(scriptPath))
_state.dofile(scriptPath);
if (std::filesystem::exists(scriptPath)) {
_state.dofile(scriptPath);
}
else {
throw Error("Couldn't load lua script: " + scriptPath);
}
}