Commit 8333f784 authored by louiz’'s avatar louiz’

Correctly call apply() when a Status is created

parent 913de04c
......@@ -60,8 +60,10 @@ public:
template <typename StatusType, typename... ArgsType>
void add_status(World* world, ArgsType&&... args)
{
this->status.push_back(std::make_unique<StatusType>(this, world,
std::forward<ArgsType>(args)...));
auto status = std::make_unique<StatusType>(this, world,
std::forward<ArgsType>(args)...);
status->apply();
this->status.push_back(std::move(status));
}
/**
* Mark this entity to be removed from the world.
......
......@@ -19,7 +19,6 @@ public:
entity(entity),
world(world)
{
this->apply();
}
virtual ~Status()
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment