diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-05-08 21:47:57 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-05-09 17:59:13 -0400 |
commit | 67b24a8ddd89371cfb944c5b441c852f0edc23b1 (patch) | |
tree | d52c054e35e680bcc65c0acafc924dc1deb6c50e /src/components | |
parent | 5c82f052c26303318e81ddd76475c1d188cc74f4 (diff) | |
download | therapy-67b24a8ddd89371cfb944c5b441c852f0edc23b1.tar.gz therapy-67b24a8ddd89371cfb944c5b441c852f0edc23b1.tar.bz2 therapy-67b24a8ddd89371cfb944c5b441c852f0edc23b1.zip |
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.
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ponderable.h | 5 |
1 files changed, 3 insertions, 2 deletions
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 @@ | |||
5 | #include "component.h" | 5 | #include "component.h" |
6 | #include "entity_manager.h" | 6 | #include "entity_manager.h" |
7 | #include "vector.h" | 7 | #include "vector.h" |
8 | #include "direction.h" | ||
8 | 9 | ||
9 | class PonderableComponent : public Component { | 10 | class PonderableComponent : public Component { |
10 | public: | 11 | public: |
@@ -84,11 +85,11 @@ public: | |||
84 | id_type ferry; | 85 | id_type ferry; |
85 | 86 | ||
86 | /** | 87 | /** |
87 | * The location of the body relative to the location of its ferry. | 88 | * The side of the ferry that the body is resting on, if there is one. |
88 | * | 89 | * |
89 | * @managed_by PonderingSystem | 90 | * @managed_by PonderingSystem |
90 | */ | 91 | */ |
91 | vec2d rel = { 0.0, 0.0 }; | 92 | Direction ferrySide; |
92 | 93 | ||
93 | /** | 94 | /** |
94 | * The bodies that are being ferried by this body. | 95 | * The bodies that are being ferried by this body. |