Ndk/BaseComponent: Fix crash

(Also fix ugly hackfix)


Former-commit-id: b176fb3abc0f541765658376fdd086241c94e279
This commit is contained in:
Lynix 2015-06-04 09:57:10 +02:00
parent 30ba25168f
commit cab52dfcfd
2 changed files with 2 additions and 6 deletions

View File

@ -7,15 +7,13 @@
#ifndef NDK_BASECOMPONENT_HPP #ifndef NDK_BASECOMPONENT_HPP
#define NDK_BASECOMPONENT_HPP #define NDK_BASECOMPONENT_HPP
#include <NDK/Prerequesites.hpp> #include <NDK/EntityHandle.hpp>
#include <functional> #include <functional>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
namespace Ndk namespace Ndk
{ {
class Entity;
class NDK_API BaseComponent class NDK_API BaseComponent
{ {
friend Entity; friend Entity;
@ -38,7 +36,7 @@ namespace Ndk
protected: protected:
ComponentIndex m_componentIndex; ComponentIndex m_componentIndex;
Entity* m_entity; EntityHandle m_entity;
static ComponentIndex RegisterComponent(ComponentId id, Factory factoryFunc); static ComponentIndex RegisterComponent(ComponentId id, Factory factoryFunc);

View File

@ -11,8 +11,6 @@ namespace Ndk
{ {
if (addDefaultSystems) if (addDefaultSystems)
AddDefaultSystems(); AddDefaultSystems();
m_entities.reserve(100); // Temporaire, je le jure
} }
inline BaseSystem& World::AddSystem(std::unique_ptr<BaseSystem>&& system) inline BaseSystem& World::AddSystem(std::unique_ptr<BaseSystem>&& system)