Skip to content

Commit 48112dd

Browse files
committed
1
1 parent 23eb3e2 commit 48112dd

File tree

4 files changed

+36
-23
lines changed

4 files changed

+36
-23
lines changed

gui/tabs/players_tab.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -1232,12 +1232,16 @@ namespace PlayersTab {
12321232
}
12331233
}
12341234
if ((IsInGame() || IsInLobby()) && ImGui::Button("Vanish Self For")) {
1235-
if (IsInGame()) State.rpcQueue.push(new RpcGoneForTarget(selectedPlayer, false));
1236-
if (IsInLobby()) State.lobbyRpcQueue.push(new RpcGoneForTarget(selectedPlayer, false));
1235+
if (IsInGame()) State.rpcQueue.push(new RpcGoneForTarget(selectedPlayer, 0));
1236+
if (IsInLobby()) State.lobbyRpcQueue.push(new RpcGoneForTarget(selectedPlayer, 0));
12371237
}
1238-
if ((IsInGame() || IsInLobby()) && ImGui::Button("Vanish Back")) {
1239-
if (IsInGame()) State.rpcQueue.push(new RpcGoneForTarget(selectedPlayer, true));
1240-
if (IsInLobby()) State.lobbyRpcQueue.push(new RpcGoneForTarget(selectedPlayer, true));
1238+
if ((IsInGame() || IsInLobby()) && ImGui::Button("Test 1")) {
1239+
if (IsInGame()) State.rpcQueue.push(new RpcGoneForTarget(selectedPlayer, 1));
1240+
if (IsInLobby()) State.lobbyRpcQueue.push(new RpcGoneForTarget(selectedPlayer, 1));
1241+
}
1242+
if ((IsInGame() || IsInLobby()) && ImGui::Button("Test 2")) {
1243+
if (IsInGame()) State.rpcQueue.push(new RpcGoneForTarget(selectedPlayer, 2));
1244+
if (IsInLobby()) State.lobbyRpcQueue.push(new RpcGoneForTarget(selectedPlayer, 2));
12411245
}
12421246
}
12431247
}

hooks/PlayerControl.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1003,8 +1003,9 @@ void dPlayerControl_StartMeeting(PlayerControl* __this, NetworkedPlayerInfo* tar
10031003

10041004
void dPlayerControl_HandleRpc(PlayerControl* __this, uint8_t callId, MessageReader* reader, MethodInfo* method) {
10051005
if (State.ShowHookLogs) LOG_DEBUG("Hook dPlayerControl_HandleRpc executed");
1006-
if (callId == 45 && MessageReader_ReadString(reader, NULL) != NULL) {
1007-
SMAC_OnCheatDetected(__this, "Overloading");
1006+
if (callId == 45) {
1007+
if (IsInLobby() || (GetPlayerData(__this)->fields.RoleType != RoleTypes__Enum::GuardianAngel))
1008+
SMAC_OnCheatDetected(__this, "Overloading");
10081009
return;
10091010
}
10101011
try {

rpc/RpcSnapTo.cpp

+22-14
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void RpcForceSnapTo::Process()
3636
CustomNetworkTransform_RpcSnapTo((Player)->fields.NetTransform, targetVector, NULL);
3737
}
3838

39-
RpcGoneForTarget::RpcGoneForTarget(PlayerSelection target, bool back)
39+
RpcGoneForTarget::RpcGoneForTarget(PlayerSelection target, uint8_t back)
4040
{
4141
this->target = target;
4242
this->back = back;
@@ -45,18 +45,26 @@ RpcGoneForTarget::RpcGoneForTarget(PlayerSelection target, bool back)
4545
void RpcGoneForTarget::Process()
4646
{
4747
if (!target.validate().has_value()) return;
48-
if (back) {
49-
auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), (*Game::pLocalPlayer)->fields._.NetId,
50-
uint8_t(RpcCalls__Enum::StartMeeting), SendOption__Enum::None, target.validate().get_PlayerControl()->fields._.OwnerId, NULL);
51-
MessageWriter_WriteByte(writer, target.validate().get_PlayerControl()->fields._.OwnerId, NULL);
52-
InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL);
53-
return;
48+
switch (back) {
49+
case 0: {
50+
auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), (*Game::pLocalPlayer)->fields.NetTransform->fields._.NetId,
51+
uint8_t(RpcCalls__Enum::SnapTo), SendOption__Enum::None, target.validate().get_PlayerControl()->fields._.OwnerId, NULL);
52+
MessageWriter_WriteUShort(writer, 0, NULL);
53+
MessageWriter_WriteUShort(writer, 0, NULL);
54+
MessageWriter_WriteUShort(writer, (*Game::pLocalPlayer)->fields.NetTransform->fields.lastSequenceId + 100, NULL);
55+
InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL);
56+
(*Game::pLocalPlayer)->fields.NetTransform->fields.lastSequenceId += 100;
57+
return;
58+
}
59+
case 1: {
60+
auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), ((*Game::pLocalPlayer)->fields.MyPhysics)->fields._.NetId,
61+
uint8_t(RpcCalls__Enum::Pet), SendOption__Enum::None, target.validate().get_PlayerControl()->fields._.OwnerId, NULL);
62+
MessageWriter_WriteUShort(writer, 0, NULL);
63+
MessageWriter_WriteUShort(writer, 0, NULL);
64+
MessageWriter_WriteUShort(writer, 65535, NULL);
65+
MessageWriter_WriteUShort(writer, 65535, NULL);
66+
InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL);
67+
return;
68+
}
5469
}
55-
auto writer = InnerNetClient_StartRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), (*Game::pLocalPlayer)->fields.NetTransform->fields._.NetId,
56-
uint8_t(RpcCalls__Enum::SnapTo), SendOption__Enum::None, target.validate().get_PlayerControl()->fields._.OwnerId, NULL);
57-
MessageWriter_WriteUShort(writer, 0, NULL);
58-
MessageWriter_WriteUShort(writer, 0, NULL);
59-
MessageWriter_WriteUShort(writer, (*Game::pLocalPlayer)->fields.NetTransform->fields.lastSequenceId + 100, NULL);
60-
InnerNetClient_FinishRpcImmediately((InnerNetClient*)(*Game::pAmongUsClient), writer, NULL);
61-
(*Game::pLocalPlayer)->fields.NetTransform->fields.lastSequenceId += 100;
6270
}

rpc/_rpc.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ class RpcBootFromVent : public RPCInterface {
473473

474474
class RpcGoneForTarget : public RPCInterface {
475475
PlayerSelection target;
476-
bool back;
476+
uint8_t back;
477477
public:
478-
RpcGoneForTarget(PlayerSelection target, bool back);
478+
RpcGoneForTarget(PlayerSelection target, uint8_t back);
479479
virtual void Process() override;
480480
};

0 commit comments

Comments
 (0)