Skip to content

Commit

Permalink
Fixed bug where OnActivate could be called before OnStart
Browse files Browse the repository at this point in the history
Bryce-Dixon committed Jul 12, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent abd3d94 commit 0c2a627
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/GameState.cpp
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ namespace GameState
GameState::GameState(Object *parent, std::string name)
: Object(parent, name)
{
StateName(name);
}

const std::string GameState::StateName()
5 changes: 5 additions & 0 deletions src/Object.cpp
Original file line number Diff line number Diff line change
@@ -204,6 +204,11 @@ void Object::TriggerOnActivate()
{
if (!Active())
return;
if (!_started)
{
OnStart();
_started = true;
}
for (Object *c : _children)
c->TriggerOnActivate();
OnActivate();

0 comments on commit 0c2a627

Please sign in to comment.