Skip to content

Commit c6caff2

Browse files
committed
Fix nullpointer deref
1 parent 13d6ad0 commit c6caff2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

AUMInjector/AUMInjector.vcxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
<ClCompile>
182182
<WarningLevel>Level3</WarningLevel>
183183
<SDLCheck>true</SDLCheck>
184-
<PreprocessorDefinitions>DEV_TOOLS;IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT;IMGUI_IMPL_WIN32_DISABLE_GAMEPAD;WIN32;_DEBUG;AUMINJECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
184+
<PreprocessorDefinitions>IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT;IMGUI_IMPL_WIN32_DISABLE_GAMEPAD;WIN32;_DEBUG;AUMINJECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
185185
<ConformanceMode>true</ConformanceMode>
186186
<PrecompiledHeader>Use</PrecompiledHeader>
187187
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>

AUMInjector/user/main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ void PlayerControl_FixedUpdate_Hook(PlayerControl* __this, MethodInfo* method)
7575
// From Player Control, get the Player Data
7676
PlayerInfo* Data = PlayerControl_GetData_Trampoline(__this, NULL);
7777
// And now we can get if we are imposter.
78-
bool isImposter = (int32_t)Data->fields.Role->fields.TeamType & (int32_t)RoleTeamTypes__Enum::Impostor;
78+
RoleBehaviour* role = Data->fields.Role;
79+
bool isImposter = role != nullptr && ((int32_t)role->fields.TeamType & (int32_t)RoleTeamTypes__Enum::Impostor) != 0;
7980
mumblePlayer.SetImposter(isImposter);
8081

8182
// Set if player is using radio

0 commit comments

Comments
 (0)