File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363#include "Sonicteam/Player/State/Object2.h"
6464#include "Sonicteam/Player/State/SonicContext.h"
6565#include "Sonicteam/Player/State/SonicObject.h"
66- #include "Sonicteam/Player/State/SonicSpinDash.h"
6766#include "Sonicteam/Player/State/TailsContext.h"
67+ #include "Sonicteam/Player/State/TailsFlight.h"
6868#include "Sonicteam/Player/Zock.h"
6969#include "Sonicteam/SaveDataTask.h"
7070#include "Sonicteam/SaveDataTaskXENON.h"
Original file line number Diff line number Diff line change 55
66namespace Sonicteam ::Player::State
77{
8- class CommonFall : public CommonObject {};
8+ class CommonFall : public CommonObject
9+ {
10+ public:
11+ MARATHON_INSERT_PADDING (8 );
12+ };
913}
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ #include < Marathon.inl>
4+
5+ namespace Sonicteam ::Player::State
6+ {
7+ class TailsFlight : public CommonFall
8+ {
9+ public:
10+ MARATHON_INSERT_PADDING (4 );
11+ be<float > m_FlightTime;
12+ };
13+ }
Original file line number Diff line number Diff line change 44
55namespace Sonicteam ::SoX::AI
66{
7- template <typename TState >
7+ template <typename TContext >
88 class StateMachine
99 {
1010 public:
1111 xpointer<void > m_pVftable;
12- xpointer<StateMachine<TState>> m_pState;
13- MARATHON_INSERT_PADDING (4 );
14- xpointer<Player::State::IContext> m_pContext;
15- MARATHON_INSERT_PADDING (4 );
16- be<float > m_Time;
12+ xpointer<StateMachine<TContext>> m_pState;
13+ xpointer<TContext> m_pContext;
14+
15+ template <typename TState>
16+ TState* GetState ()
17+ {
18+ return (TState*)m_pState.get ();
19+ }
1720
18- template <typename TContext = Player::State::IContext>
1921 TContext* GetContext ()
2022 {
2123 return (TContext*)m_pContext.get ();
Original file line number Diff line number Diff line change @@ -23,14 +23,14 @@ PPC_FUNC(sub_8221A7D8)
2323 pGauge->m_Value = (100 .0f / pTailsContext->m_FlightDuration ) * pTailsContext->m_FlightTime ;
2424 }
2525
26- auto pState = pPlayer->m_spStateMachine ->GetBase ()->m_pState ;
26+ auto pTailsFlight = pPlayer->m_spStateMachine ->GetBase ()->GetState <Sonicteam::Player::State::TailsFlight>() ;
2727 auto pGameImp = App::s_pApp->m_pDoc ->GetDocMode <Sonicteam::GameMode>()->m_pGameImp ;
2828
2929 auto maturityValue = 1 .0f ;
3030
3131 // Set maturity value if the current state is Sonicteam::Player::State::TailsFlight.
32- if (pState ->m_pVftable .ptr == 0x82005404 )
33- maturityValue = (1 .0f / pTailsContext->m_FlightLimit ) * pState-> m_Time ;
32+ if (pTailsFlight ->m_pVftable .ptr == 0x82005404 )
33+ maturityValue = (1 .0f / pTailsContext->m_FlightLimit ) * pTailsFlight-> m_FlightTime ;
3434
3535 for (int i = 0 ; i < 4 ; i++)
3636 {
You can’t perform that action at this time.
0 commit comments