From db7e8ae3a011d3f7b1afd505412abee17b309ba3 Mon Sep 17 00:00:00 2001 From: Dillon Skaggs Date: Mon, 21 Oct 2024 22:41:06 -0500 Subject: [PATCH] fix(mono): fix breakage accidentally introduced in #2740 --- code/client/clrcore/External/Tasks.cs | 44 +++++++++++++++++++++------ 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/code/client/clrcore/External/Tasks.cs b/code/client/clrcore/External/Tasks.cs index 3a730f7480..1b092c392c 100644 --- a/code/client/clrcore/External/Tasks.cs +++ b/code/client/clrcore/External/Tasks.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; #if MONO_V2 using CitizenFX.Core; @@ -301,25 +302,48 @@ public void LeaveVehicle(Vehicle vehicle, LeaveVehicleFlags flags) API.TaskLeaveVehicle(_ped.Handle, vehicle.Handle, (int)flags); } + /// + /// Looks at the specified . + /// + /// + /// Must be greater than 0 for the ped to actually move their head. + /// + public void LookAt(Entity target, int duration = 1, LookFlags flag = LookFlags.FastTurnRate) + { + API.TaskLookAtEntity(_ped.Handle, target.Handle, duration, 0, (int)flag); + } + /// - /// Looks at the specified . + /// Looks at the specified this will always be set to , use the overload to be able to set the Look flags. /// /// /// Must be greater than 0 for the ped to actually move their head. - /// - public void LookAt(Entity target, int duration = 1, LookFlags flag = LookFlags.FastTurnRate) - { - API.TaskLookAtEntity(_ped.Handle, target.Handle, duration, 0, (int)flag); - } + [EditorBrowsable(EditorBrowsableState.Never)] + public void LookAt(Entity target, int duration = 1) + { + API.TaskLookAtEntity(_ped.Handle, target.Handle, duration, 0, 2); + } + + /// + /// Looks at the specified position. + /// + /// + /// Must be greater than 0 for the ped to actually move their head. + /// + public void LookAt(Vector3 position, int duration = 1, LookFlags flag = LookFlags.FastTurnRate) + { + API.TaskLookAtCoord(_ped.Handle, position.X, position.Y, position.Z, duration, 0, (int)flag); + } + /// - /// Looks at the specified position. + /// Looks at the specified position this will always be set to , use the overload to be able to set the Look flags. /// /// /// Must be greater than 0 for the ped to actually move their head. - /// - public void LookAt(Vector3 position, int duration = 1, LookFlags flag = LookFlags.FastTurnRate) + [EditorBrowsable(EditorBrowsableState.Never)] + public void LookAt(Vector3 position, int duration = 1) { - API.TaskLookAtCoord(_ped.Handle, position.X, position.Y, position.Z, duration, 0, (int)flag); + API.TaskLookAtCoord(_ped.Handle, position.X, position.Y, position.Z, duration, 0, 2); } public void ParachuteTo(Vector3 position)