]> git.tdb.fi Git - libs/game.git/commitdiff
Adjust system dependencies to resolve scheduling ambiguities
authorMikko Rasa <tdb@tdb.fi>
Wed, 7 Dec 2022 10:03:35 +0000 (12:03 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 7 Dec 2022 10:03:35 +0000 (12:03 +0200)
examples/bassteroids/source/damagedealer.cpp
examples/bassteroids/source/physics.cpp

index 7c8e873049d9415ceee3318cd8f01db96860f0dc..a7887876bc5bfeb764e23d0395dc5b528e7cf58a 100644 (file)
@@ -2,6 +2,7 @@
 #include <msp/game/stage.h>
 #include "collider.h"
 #include "hittable.h"
+#include "physics.h"
 
 using namespace Msp;
 
@@ -11,6 +12,7 @@ DamageDealer::DamageDealer(Game::Stage &s):
 {
        declare_dependency<HitPoints>(UPDATE);
        declare_dependency<DamageSource>(READ_OLD);
+       declare_dependency<Physics>(RUN_AFTER);
 
        observer.observe<Events::Collision>([this](auto &e){ collision(e); });
 }
index 158b745ca83f6e0af19597e7fc7e4df9876e8365..5ce35283d7c8d923a993c7ede413f85e4d909d4b 100644 (file)
@@ -12,7 +12,7 @@ Physics::Physics(Game::Stage &s):
        observer(stage.get_event_bus())
 {
        declare_dependency<Game::Transform>(UPDATE);
-       declare_dependency<RigidBody>(UPDATE);
+       declare_dependency<RigidBody>(CHAINED_UPDATE);
        declare_dependency<Collider>(READ_OLD);
 
        observer.observe<Game::Events::EntityCreated>([this](auto &e){ entity_added(e); });