Skip to content

Commit

Permalink
Small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scp222thj committed Jan 5, 2024
1 parent 9f8882f commit a8ba49a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
6 changes: 1 addition & 5 deletions src/RPCExploit/Shapeshift/RevertShapeshiftersPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ public static void Postfix(PlayerPhysics __instance){
foreach (var sender in PlayerControl.AllPlayerControls)
{
if (sender.CurrentOutfitType != PlayerOutfitType.Default){
if (sender.AmOwner){
Utils.ShapeshiftPlayer(sender, sender, !CheatToggles.noCooldowns_shapeshifter);
}else{
Utils.ShapeshiftPlayer(sender, sender, true);
}
Utils.ShapeshiftPlayer(sender, sender, false);
}
}

Expand Down
42 changes: 22 additions & 20 deletions src/Spoofing/SpoofingCheatsPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,32 @@ public static class SpoofFriendCode_EOSManager_Update_Postfix
//Postfix patch of EOSManager.Update to spoof friend codes
public static void Postfix(EOSManager __instance)
{
if (CheatToggles.spoofRandomFC){ //spoofRandomFC cheat logic
if (defaultFC == null){
defaultFC = __instance.FriendCode; //Save default friend code before randomizing it
}
try{
if (CheatToggles.spoofRandomFC){ //spoofRandomFC cheat logic
if (defaultFC == null){
defaultFC = __instance.FriendCode; //Save default friend code before randomizing it
}

//Generate and save a completly random friend code
string username = DestroyableSingleton<AccountManager>.Instance.GetRandomName().ToLower();
string discriminator = new System.Random().Next(1000, 10000).ToString();
__instance.FriendCode = username + "#" + discriminator;
//Generate and save a completly random friend code
string username = DestroyableSingleton<AccountManager>.Instance.GetRandomName().ToLower();
string discriminator = new System.Random().Next(1000, 10000).ToString();
__instance.FriendCode = username + "#" + discriminator;

return; //Do not use friend code spoofing from config if spoofRandomFC cheat is already going on
}
return; //Do not use friend code spoofing from config if spoofRandomFC cheat is already going on
}

if (MalumMenu.spoofFriendCode.Value != "" && MalumMenu.spoofFriendCode.Value != __instance.FriendCode){ //friendCodeSpoofing from config cheat logic
__instance.FriendCode = MalumMenu.spoofFriendCode.Value; //Set custom friend code from config file

return;
}
if (MalumMenu.spoofFriendCode.Value != "" && MalumMenu.spoofFriendCode.Value != __instance.FriendCode){ //friendCodeSpoofing from config cheat logic
__instance.FriendCode = MalumMenu.spoofFriendCode.Value; //Set custom friend code from config file
return;
}

//Return to default friend code if both cheats are disabled
if (defaultFC != null){
__instance.FriendCode = defaultFC;
defaultFC = null;
}
//Return to default friend code if both cheats are disabled
if (defaultFC != null){
__instance.FriendCode = defaultFC;
defaultFC = null;
}
}catch{}
}
}

Expand Down

0 comments on commit a8ba49a

Please sign in to comment.