File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,13 +37,14 @@ namespace Sonicteam
3737 template <typename T>
3838 inline T* GetPhysicsWorld ();
3939
40- int32_t PlayerActorIDToIndex (int32_t ActorID)
40+ int32_t PlayerActorIDToIndex (int32_t actorId) const
4141 {
4242 for (int i = 0 ; i < 4 ; i++)
4343 {
44- if (m_PlayerData[i].ActorID == ActorID )
44+ if (m_PlayerData[i].ActorID == actorId )
4545 return i;
4646 }
47+
4748 return -1 ;
4849 }
4950 };
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ namespace Sonicteam::Player
1313 MARATHON_INSERT_PADDING (0x2C );
1414 bool m_IsPlayer;
1515 bool m_IsPosture;
16- bool m_IsAmigo; // AI::Amigo
16+ bool m_IsAmigo;
1717 MARATHON_INSERT_PADDING (0x19 );
1818 boost::shared_ptr<State::Machine2> m_spStateMachine;
1919 MARATHON_INSERT_PADDING (0x10 );
20- be<uint32_t > m_SetupModuleIndexPre ;
21- be<uint32_t > m_SetupModuleIndexPost ;
20+ be<uint32_t > m_SetupModuleIndexPrefix ;
21+ be<uint32_t > m_SetupModuleIndexPostfix ;
2222 boost::shared_ptr<IGauge> m_spGauge;
2323 MARATHON_INSERT_PADDING (0x204 );
2424
Original file line number Diff line number Diff line change 44
55namespace Sonicteam ::SoX::Input
66{
7-
87 enum KeyState
98 {
109 KeyState_DpadUp = 0x40 ,
@@ -26,7 +25,7 @@ namespace Sonicteam::SoX::Input
2625 struct PadState
2726 {
2827 be<uint32_t > LastButtons;
29- be<uint32_t > InvertedLastButtons; // ~wLastButtons
28+ be<uint32_t > InvertedLastButtons;
3029 MARATHON_INSERT_PADDING (8 );
3130
3231 be<float > LeftStickHorizontal;
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include < kernel/heap.h>
4- #include < kernel/function.h>
5-
63namespace stdx
74{
85 template <typename Type>
Original file line number Diff line number Diff line change @@ -133,17 +133,18 @@ PPC_FUNC(sub_82195500)
133133 return ;
134134 }
135135
136- auto pDoc = App::s_pApp->m_pDoc ;
137- auto pGameImp = App::s_pApp->m_pDoc ->GetDocMode <Sonicteam::GameMode>()->m_pGameImp ;
138136 auto pPlayer = (Sonicteam::Player::Object*)(base + ctx.r3 .u32 );
137+ auto pDoc = App::s_pApp->m_pDoc ;
139138
140- if (pPlayer-> m_SetupModuleIndexPost != - 2 && pPlayer-> m_IsPlayer )
139+ if (auto pGameMode = pDoc-> GetDocMode <Sonicteam::GameMode>() )
141140 {
142- auto PIndex = pGameImp->PlayerActorIDToIndex (pPlayer->m_ActorID );
143- auto PManager = pDoc->m_vspInputManager [pDoc->m_PlayerControllerID [PIndex].get ()].get ();
144- if ((PManager->m_PadState .LastButtons .get () & Sonicteam::SoX::Input::KeyState_Select) != 0 )
141+ if (pPlayer->m_SetupModuleIndexPostfix != -2 && pPlayer->m_IsPlayer )
145142 {
146- pPlayer->m_SetupModuleIndexPost = 2 ;
143+ auto playerIndex = pGameMode->m_pGameImp ->PlayerActorIDToIndex (pPlayer->m_ActorID );
144+ auto & spManager = pDoc->m_vspInputManager [pDoc->m_PlayerControllerID [playerIndex]];
145+
146+ if ((spManager->m_PadState .LastButtons .get () & Sonicteam::SoX::Input::KeyState_Select) != 0 )
147+ pPlayer->m_SetupModuleIndexPostfix = 2 ;
147148 }
148149 }
149150
You can’t perform that action at this time.
0 commit comments