private static bool OnPlayerMovementSync(PlayerMovementSync __instance) { try { var player = __instance.GetPlayer(); var args = player.setClassEventArgs; //It is null when someone is revived by 049 since the first patch is never called in this situation if (args == null) { return(true); } Timing.RunCoroutine(__instance.SafelySpawnPlayer(args.Position, args.Rotation), Segment.FixedUpdate); return(false); } catch (Exception e) { Logger.Get.Error($"Synapse-Event: PlayerSetClass(Position) failed!!\n{e}"); return(true); } }
private static bool OnPlayerMovementSync(PlayerMovementSync __instance) { try { var player = __instance.GetPlayer(); var args = player.setClassEventArgs; if (player.LiteRoleSet) { return(false); } if (args == null) { return(true); } var rot = new PlayerMovementSync.PlayerRotation?(new PlayerMovementSync.PlayerRotation(new float?(0f), new float?(args.Rotation))); Timing.RunCoroutine(__instance.SafelySpawnPlayer(args.Position, rot), Segment.FixedUpdate); return(false); } catch (Exception e) { Logger.Get.Error($"Synapse-Event: PlayerSetClass(Position) failed!!\n{e}"); return(true); } }