Restore ai/registry.hpp

Because obviously calling an empty function is essential for AI to work
correctly in GCC/Clang builds. #logic
This commit is contained in:
Jyrki Vesterinen 2018-02-21 21:03:07 +02:00
parent 7f91caf57f
commit eb900c980c
5 changed files with 40 additions and 0 deletions

View file

@ -3564,6 +3564,7 @@
<ClInclude Include="..\..\src\ai\lua\engine_lua.hpp" />
<ClInclude Include="..\..\src\ai\lua\lua_object.hpp" />
<ClInclude Include="..\..\src\ai\manager.hpp" />
<ClInclude Include="..\..\src\ai\registry.hpp" />
<ClInclude Include="..\..\src\ai\simulated_actions.hpp" />
<ClInclude Include="..\..\src\ai\testing.hpp" />
<ClInclude Include="..\..\src\animated.hpp" />

View file

@ -1596,6 +1596,9 @@
<ClInclude Include="..\..\src\ai\manager.hpp">
<Filter>AI</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ai\registry.hpp">
<Filter>AI</Filter>
</ClInclude>
<ClInclude Include="..\..\src\ai\simulated_actions.hpp">
<Filter>AI</Filter>
</ClInclude>

View file

@ -37,6 +37,7 @@
#include "ai/game_info.hpp" // for side_number, engine_ptr, etc
#include "game_config.hpp" // for debug
#include "ai/lua/aspect_advancements.hpp"
#include "ai/registry.hpp" // for init
#include <algorithm> // for min
#include <cassert> // for assert
@ -315,6 +316,7 @@ manager::manager()
, last_interact_(0)
, num_interact_(0)
{
registry::init();
singleton_ = this;
}

View file

@ -17,6 +17,8 @@
* @file
*/
#include "ai/registry.hpp"
#include "config.hpp" // for config, operator<<
#include "terrain/filter.hpp" // for terrain_filter
#include "ai/composite/engine.hpp" // for register_engine_factory
@ -475,4 +477,8 @@ static register_aspect_factory< default_recruitment::recruitment_aspect >
static register_aspect_factory< default_recruitment::recruitment_aspect >
recruitment__standard_aspect_factory2("recruitment*");
void registry::init()
{
}
} //end of namespace ai

28
src/ai/registry.hpp Normal file
View file

@ -0,0 +1,28 @@
/*
Copyright (C) 2009 - 2018 by Yurii Chernyi <terraninfo@terraninfo.net>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
/**
* @file
* All known AI parts
*/
#pragma once
namespace ai {
namespace registry {
void init();
}
} //end of namespace ai