Skip to content

Commit

Permalink
Fix nullpointer deref
Browse files Browse the repository at this point in the history
  • Loading branch information
StarGate01 committed Nov 19, 2021
1 parent 13d6ad0 commit c6caff2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AUMInjector/AUMInjector.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>DEV_TOOLS;IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT;IMGUI_IMPL_WIN32_DISABLE_GAMEPAD;WIN32;_DEBUG;AUMINJECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT;IMGUI_IMPL_WIN32_DISABLE_GAMEPAD;WIN32;_DEBUG;AUMINJECTOR_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
Expand Down
3 changes: 2 additions & 1 deletion AUMInjector/user/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ void PlayerControl_FixedUpdate_Hook(PlayerControl* __this, MethodInfo* method)
// From Player Control, get the Player Data
PlayerInfo* Data = PlayerControl_GetData_Trampoline(__this, NULL);
// And now we can get if we are imposter.
bool isImposter = (int32_t)Data->fields.Role->fields.TeamType & (int32_t)RoleTeamTypes__Enum::Impostor;
RoleBehaviour* role = Data->fields.Role;
bool isImposter = role != nullptr && ((int32_t)role->fields.TeamType & (int32_t)RoleTeamTypes__Enum::Impostor) != 0;
mumblePlayer.SetImposter(isImposter);

// Set if player is using radio
Expand Down

0 comments on commit c6caff2

Please sign in to comment.