Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mc2hook/mc2hook/handlers/MaxVelocityHandler.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "MaxVelocityHandler.h"

void MaxVelocityHandler::Install()
{
float maxVelocity = HookConfig::GetFloat("Physics", "MaxVelocity", 111.75 * 2.237); // In mph format
mem::write(0x569195 + 3, static_cast<float>(maxVelocity / 2.237)); // mph to ms
}
8 changes: 8 additions & 0 deletions mc2hook/mc2hook/handlers/MaxVelocityHandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once
#include <mc2hook\mc2hook.h>

class MaxVelocityHandler
{
public:
static void Install();
};
2 changes: 2 additions & 0 deletions mc2hook/mc2hook/handlers/handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <handlers\InputHandler.h>
#include <handlers\BorderlessHandler.h>
#include <handlers\ReflectionFidelityHandler.h>
#include <handlers/MaxVelocityHandler.h>

#include <handlers\StateResearchHook.h>

Expand All @@ -35,6 +36,7 @@ static void InstallHandlersPostEngineInit()
InstallHandler<PathHandler>("Path Handler");
InstallHandler<TestPanelHandler>("Panel Handler (Keyboard input test really)");
InstallHandler<vehTransmissionHandler>("Transmission Handler");
InstallHandler<MaxVelocityHandler>("Max Velocity Handler");
}

// Installed at game launch
Expand Down
2 changes: 2 additions & 0 deletions mc2hook/mc2hook/mc2hook.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
<ClInclude Include="handlers\handlers.h" />
<ClInclude Include="handlers\HybridFileMethodsHandler.h" />
<ClInclude Include="handlers\InputHandler.h" />
<ClInclude Include="handlers\MaxVelocityHandler.h" />
<ClInclude Include="handlers\PathHandler.h" />
<ClInclude Include="handlers\PrinterHandler.h" />
<ClInclude Include="handlers\ReflectionFidelityHandler.h" />
Expand Down Expand Up @@ -247,6 +248,7 @@
<ClCompile Include="handlers\FontCrashFixHandler.cpp" />
<ClCompile Include="handlers\HybridFileMethodsHandler.cpp" />
<ClCompile Include="handlers\InputHandler.cpp" />
<ClCompile Include="handlers\MaxVelocityHandler.cpp" />
<ClCompile Include="handlers\PathHandler.cpp" />
<ClCompile Include="handlers\PrinterHandler.cpp" />
<ClCompile Include="handlers\ReflectionFidelityHandler.cpp" />
Expand Down