mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 23:50:29 +01:00
Disabled debug messages. Added check for ped's current vehicle, and current vehicle's driver.
This commit is contained in:
parent
ff4fb0de89
commit
555db52189
1 changed files with 14 additions and 11 deletions
|
|
@ -44,56 +44,59 @@ namespace SceneManager.Utils
|
||||||
// If ped relationship group does not contain "cop" then this extension doesn't apply
|
// If ped relationship group does not contain "cop" then this extension doesn't apply
|
||||||
if (pedType == PedType.Cop && !ped.RelationshipGroup.Name.ToLower().Contains("cop"))
|
if (pedType == PedType.Cop && !ped.RelationshipGroup.Name.ToLower().Contains("cop"))
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Ped does not belong to a cop relationship group.");
|
//Game.LogTrivial($"Ped does not belong to a cop relationship group.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ped is in a vehicle
|
// Ped is in a vehicle
|
||||||
if (taskInVehicleBasic)
|
if (taskInVehicleBasic)
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Ped is in a vehicle.");
|
//Game.LogTrivial($"Ped is in a vehicle.");
|
||||||
// Ped has a controlled driving task
|
// Ped has a controlled driving task
|
||||||
if (taskControlVehicle)
|
if (taskControlVehicle)
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Ped has a controlled driving task. (non-ambient)");
|
//Game.LogTrivial($"Ped has a controlled driving task. (non-ambient)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ped has a wander driving task
|
// Ped has a wander driving task
|
||||||
if (taskCarDriveWander)
|
if (taskCarDriveWander)
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Ped has a wander driving task. (ambient)");
|
//Game.LogTrivial($"Ped has a wander driving task. (ambient)");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the ped is in a vehicle but doesn't have a driving task, then it's a passenger. Check if the vehicle's driver has a driving wander task
|
// If the ped is in a vehicle but doesn't have a driving task, then it's a passenger. Check if the vehicle's driver has a driving wander task
|
||||||
|
if (ped.CurrentVehicle && ped.CurrentVehicle.Driver)
|
||||||
|
{
|
||||||
var driverHasWanderTask = Rage.Native.NativeFunction.Natives.GET_IS_TASK_ACTIVE<bool>(ped.CurrentVehicle.Driver, 151);
|
var driverHasWanderTask = Rage.Native.NativeFunction.Natives.GET_IS_TASK_ACTIVE<bool>(ped.CurrentVehicle.Driver, 151);
|
||||||
if (driverHasWanderTask)
|
if (driverHasWanderTask)
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Ped is a passenger. Vehicle's driver has a wander driving task. (ambient)");
|
//Game.LogTrivial($"[Ambient Ped Check]: Ped is a passenger. Vehicle's driver has a wander driving task. (ambient)");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ped.IsOnFoot)
|
if (ped.IsOnFoot)
|
||||||
{
|
{
|
||||||
// UB unit on-foot, waiting for interaction
|
// UB unit on-foot, waiting for interaction
|
||||||
if (ped.RelationshipGroup.Name == "UBCOP")
|
if (ped.RelationshipGroup.Name == "UBCOP")
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Cop is UB unit. (non-ambient)");
|
//Game.LogTrivial($"Cop is UB unit. (non-ambient)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cop ped walking around or standing still
|
// Cop ped walking around or standing still
|
||||||
if ((taskComplexControlMovement && taskWanderingScenario) || (taskAmbientClips && taskUseScenario))
|
if ((taskComplexControlMovement && taskWanderingScenario) || (taskAmbientClips && taskUseScenario))
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Ped is wandering around or standing still. (ambient)");
|
//Game.LogTrivial($"Ped is wandering around or standing still. (ambient)");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If nothing else returns true before now, then the ped is probably being controlled and doing something else
|
// If nothing else returns true before now, then the ped is probably being controlled and doing something else
|
||||||
Game.LogTrivial($"Nothing else has returned true by this point. (non-ambient)");
|
//Game.LogTrivial($"Nothing else has returned true by this point. (non-ambient)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue