From c3baee5b9c6f47bb8f7d35cd2540c596769696d8 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 1 Aug 2014 17:01:58 +0200 Subject: [PATCH] Register the character's collision bar to the mover. This fixes the non-working collision detection. --- src/character.cpp | 6 ++++++ src/character.hpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/character.cpp b/src/character.cpp index 8a530b3..948e8f6 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -79,4 +79,10 @@ namespace cloonel { void Character::Draw() const { m_texture->Render(GetPos(), WidthHeight(), m_screenRatio.Ratio(), true); } + + ///------------------------------------------------------------------------- + ///------------------------------------------------------------------------- + void Character::OnRegister (Mover& parMover, Mover::PlaceableTicketType parParentTicket) { + parMover.RegisterPlaceable(&m_bottomBar, parParentTicket); + } } //namespace cloonel diff --git a/src/character.hpp b/src/character.hpp index cd6741f..611b1bb 100644 --- a/src/character.hpp +++ b/src/character.hpp @@ -45,6 +45,9 @@ namespace cloonel { void RegisterForCollision ( ColliderRegisterFunc parRegisterCollision ); private: + //Overrides + virtual void OnRegister ( Mover& parMover, Mover::PlaceableTicketType parParentTicket ); + HorzCollisionBar m_bottomBar; SizeNotifiable m_screenRatio; const std::unique_ptr m_texture;