Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit 38cfc5d

Browse files
authored
fix PlayerControl_RpcSetRole (#642)
1 parent c8ba629 commit 38cfc5d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

appdata/il2cpp-functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ DO_APP_FUNC(void, PlayerControl_MurderPlayer, (PlayerControl* __this, PlayerCont
9292
DO_APP_FUNC(void, PlayerControl_RpcMurderPlayer, (PlayerControl* __this, PlayerControl* target, bool didSucceed, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcMurderPlayer(PlayerControl, System.Boolean)");
9393
DO_APP_FUNC(void, PlayerControl_ReportDeadBody, (PlayerControl* __this, NetworkedPlayerInfo* target, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::ReportDeadBody(NetworkedPlayerInfo)");
9494
DO_APP_FUNC(void, PlayerControl_StartMeeting, (PlayerControl* __this, NetworkedPlayerInfo* target, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::StartMeeting(NetworkedPlayerInfo)");
95-
DO_APP_FUNC(void, PlayerControl_RpcSetRole, (PlayerControl* __this, RoleTypes__Enum roleType, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcSetRole(AmongUs.GameOptions.RoleTypes)");
95+
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)");
9696
DO_APP_FUNC(void, PlayerControl_RpcSetScanner, (PlayerControl* __this, bool value, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcSetScanner(System.Boolean)");
9797
DO_APP_FUNC(void, PlayerControl_CmdCheckColor, (PlayerControl* __this, uint8_t bodyColor, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::CmdCheckColor(System.Byte)");
9898
DO_APP_FUNC(void, PlayerControl_RpcSetColor, (PlayerControl* __this, uint8_t bodyColor, MethodInfo* method), "Assembly-CSharp, System.Void PlayerControl::RpcSetColor(System.Byte)");

hooks/RoleManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void AssignPreChosenRoles(RoleRates& roleRates, std::vector<uint8_t>& assignedPl
4040
auto trueRole = GetRoleTypesEnum(role);
4141
roleRates.SubtractRole(trueRole);
4242

43-
PlayerControl_RpcSetRole(player, trueRole, NULL);
43+
PlayerControl_RpcSetRole(player, trueRole, false, NULL);
4444
assignedPlayers.push_back(player->fields.PlayerId);
4545
}
4646
}
@@ -87,7 +87,7 @@ void AssignRoles(RoleRates& roleRates, int roleChance, RoleTypes__Enum role, il2
8787
if (CanPlayerBeAssignedToRole(player, assignedPlayers))
8888
{
8989
roleRates.SubtractRole(role);
90-
PlayerControl_RpcSetRole(player, role, NULL);
90+
PlayerControl_RpcSetRole(player, role, false, NULL);
9191
assignedPlayers.push_back(player->fields.PlayerId);
9292
break;
9393
}

rpc/RpcSetRole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ RpcSetRole::RpcSetRole(PlayerControl* player, RoleTypes__Enum role)
1010

1111
void RpcSetRole::Process()
1212
{
13-
PlayerControl_RpcSetRole(Player, Role, NULL);
13+
PlayerControl_RpcSetRole(Player, Role, false, NULL);
1414
}

0 commit comments

Comments
 (0)