From 67b24a8ddd89371cfb944c5b441c852f0edc23b1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 8 May 2018 21:47:57 -0400 Subject: Fixed ferries pushing passengers Ferries now pretend that their passengers have already moved by the appropriate delta when detecting collision in the direction of their passengers. This allows a ferry to move into the space where their passengers are when there is nothing else blocking it. It also allows for special behavior when a passenger is crushed between its ferry and a wall, but this is not yet implemented. This fixes the first issue described in 8f1c4f1 -- that ferries cannot push their passengers. With this fix, ferries are basically functional. --- src/components/ponderable.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/ponderable.h b/src/components/ponderable.h index c0312b4..e6aa976 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h @@ -5,6 +5,7 @@ #include "component.h" #include "entity_manager.h" #include "vector.h" +#include "direction.h" class PonderableComponent : public Component { public: @@ -84,11 +85,11 @@ public: id_type ferry; /** - * The location of the body relative to the location of its ferry. + * The side of the ferry that the body is resting on, if there is one. * * @managed_by PonderingSystem */ - vec2d rel = { 0.0, 0.0 }; + Direction ferrySide; /** * The bodies that are being ferried by this body. -- cgit 1.4.1