diff --git a/appdata/il2cpp-functions.h b/appdata/il2cpp-functions.h index 7336d020..354f2883 100644 --- a/appdata/il2cpp-functions.h +++ b/appdata/il2cpp-functions.h @@ -92,7 +92,7 @@ DO_APP_FUNC(void, PlayerControl_MurderPlayer, (PlayerControl* __this, PlayerCont DO_APP_FUNC(void, PlayerControl_RpcMurderPlayer, (PlayerControl* __this, PlayerControl* target, bool didSucceed, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcMurderPlayer(PlayerControl, System.Boolean)"); DO_APP_FUNC(void, PlayerControl_ReportDeadBody, (PlayerControl* __this, NetworkedPlayerInfo* target, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::ReportDeadBody(NetworkedPlayerInfo)"); DO_APP_FUNC(void, PlayerControl_StartMeeting, (PlayerControl* __this, NetworkedPlayerInfo* target, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::StartMeeting(NetworkedPlayerInfo)"); -DO_APP_FUNC(void, PlayerControl_RpcSetRole, (PlayerControl* __this, RoleTypes__Enum roleType, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcSetRole(AmongUs.GameOptions.RoleTypes)"); +DO_APP_FUNC(void, PlayerControl_RpcSetRole, (PlayerControl* __this, RoleTypes__Enum roleType, bool canOverrideRole, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcSetRole(AmongUs.GameOptions.RoleTypes, System.Boolean)"); DO_APP_FUNC(void, PlayerControl_RpcSetScanner, (PlayerControl* __this, bool value, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcSetScanner(System.Boolean)"); DO_APP_FUNC(void, PlayerControl_CmdCheckColor, (PlayerControl* __this, uint8_t bodyColor, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::CmdCheckColor(System.Byte)"); DO_APP_FUNC(void, PlayerControl_RpcSetColor, (PlayerControl* __this, uint8_t bodyColor, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcSetColor(System.Byte)"); diff --git a/hooks/RoleManager.cpp b/hooks/RoleManager.cpp index e0992915..1acd9802 100644 --- a/hooks/RoleManager.cpp +++ b/hooks/RoleManager.cpp @@ -40,7 +40,7 @@ void AssignPreChosenRoles(RoleRates& roleRates, std::vector& assignedPl auto trueRole = GetRoleTypesEnum(role); roleRates.SubtractRole(trueRole); - PlayerControl_RpcSetRole(player, trueRole, NULL); + PlayerControl_RpcSetRole(player, trueRole, false, NULL); assignedPlayers.push_back(player->fields.PlayerId); } } @@ -87,7 +87,7 @@ void AssignRoles(RoleRates& roleRates, int roleChance, RoleTypes__Enum role, il2 if (CanPlayerBeAssignedToRole(player, assignedPlayers)) { roleRates.SubtractRole(role); - PlayerControl_RpcSetRole(player, role, NULL); + PlayerControl_RpcSetRole(player, role, false, NULL); assignedPlayers.push_back(player->fields.PlayerId); break; } diff --git a/rpc/RpcSetRole.cpp b/rpc/RpcSetRole.cpp index 432bf404..cb4f401b 100644 --- a/rpc/RpcSetRole.cpp +++ b/rpc/RpcSetRole.cpp @@ -10,5 +10,5 @@ RpcSetRole::RpcSetRole(PlayerControl* player, RoleTypes__Enum role) void RpcSetRole::Process() { - PlayerControl_RpcSetRole(Player, Role, NULL); + PlayerControl_RpcSetRole(Player, Role, false, NULL); } \ No newline at end of file