@@ -106,29 +106,30 @@ static constexpr size_t OBJ_GRIND_DASH_PANEL_SIZE = 0x160;
106106
107107void ObjGrindDashPanelAllocMidAsmHook (PPCRegister& r3)
108108{
109- r3.u32 += sizeof (std::chrono::steady_clock::time_point );
109+ r3.u32 += sizeof (double );
110110}
111111
112112// SWA::CObjGrindDashPanel::CObjGrindDashPanel
113113PPC_FUNC_IMPL (__imp__sub_82614228);
114114PPC_FUNC (sub_82614228)
115115{
116- new (base + ctx.r3 .u32 + OBJ_GRIND_DASH_PANEL_SIZE ) std::chrono::steady_clock::time_point () ;
116+ * reinterpret_cast < double *> (base + ctx.r3 .u32 + OBJ_GRIND_DASH_PANEL_SIZE ) = 0.0 ;
117117 __imp__sub_82614228 (ctx, base);
118118}
119119
120120// SWA::CObjGrindDashPanel::MsgHitEventCollision::Impl
121121PPC_FUNC_IMPL (__imp__sub_826145D8);
122122PPC_FUNC (sub_826145D8)
123123{
124- auto pLastHitTime = (std::chrono::steady_clock::time_point*)g_memory.Translate (ctx.r3 .u32 + OBJ_GRIND_DASH_PANEL_SIZE );
125- auto now = std::chrono::steady_clock::now ();
126- auto deltaTime = std::min (std::chrono::duration<double >(now - *pLastHitTime).count (), 1.0 / 15.0 );
124+ constexpr double REFERENCE_DELTA_TIME = 1.0 / 30.0 ;
125+ constexpr double DELTA_TIME_TOLERANCE = 0.0001 ;
127126
128- *pLastHitTime = now;
127+ auto lastHitTime = reinterpret_cast <double *>(base + ctx.r3 .u32 + OBJ_GRIND_DASH_PANEL_SIZE );
128+ auto deltaTime = App::s_time - *lastHitTime;
129129
130- if (deltaTime < 1.0 / 30.0 )
131- return ;
132-
133- __imp__sub_826145D8 (ctx, base);
130+ if ((deltaTime + DELTA_TIME_TOLERANCE ) > REFERENCE_DELTA_TIME )
131+ {
132+ __imp__sub_826145D8 (ctx, base);
133+ *lastHitTime = App::s_time;
134+ }
134135}
0 commit comments