mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 15:40:29 +01:00
Refactored for new DismissOption and Path object now handling lists of collected vehicles
This commit is contained in:
parent
497e0c423f
commit
066395666c
1 changed files with 20 additions and 3 deletions
|
|
@ -41,7 +41,7 @@ namespace SceneManager
|
|||
//Logger.Log($"{Vehicle.Model.Name} and driver are now persistent.");
|
||||
}
|
||||
|
||||
internal void Dismiss(DismissOption dismissOption = DismissOption.FromPath)
|
||||
internal void Dismiss(DismissOption dismissOption = DismissOption.FromPath, Path newPath = null)
|
||||
{
|
||||
if (!Vehicle || !Driver)
|
||||
{
|
||||
|
|
@ -66,7 +66,7 @@ namespace SceneManager
|
|||
Vehicle.Dismiss();
|
||||
}
|
||||
Rage.Native.NativeFunction.Natives.x260BE8F09E326A20(Vehicle, 0f, 1, true);
|
||||
VehicleCollector.collectedVehicles.Remove(this);
|
||||
Path.CollectedVehicles.Remove(this);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +89,11 @@ namespace SceneManager
|
|||
DismissFromPath();
|
||||
}
|
||||
|
||||
if(dismissOption == DismissOption.FromDirected)
|
||||
{
|
||||
DismissFromDirect();
|
||||
}
|
||||
|
||||
void DismissFromWorld()
|
||||
{
|
||||
Game.LogTrivial($"Dismissed {Vehicle.Model.Name} from the world");
|
||||
|
|
@ -151,7 +156,7 @@ namespace SceneManager
|
|||
|
||||
if (!Directed)
|
||||
{
|
||||
VehicleCollector.collectedVehicles.Remove(this);
|
||||
Path.CollectedVehicles.Remove(this);
|
||||
Logger.Log($"{Vehicle.Model.Name} dismissed successfully.");
|
||||
if (Driver)
|
||||
{
|
||||
|
|
@ -172,6 +177,18 @@ namespace SceneManager
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
void DismissFromDirect()
|
||||
{
|
||||
Dismissed = true;
|
||||
Directed = true;
|
||||
if (newPath != null)
|
||||
{
|
||||
newPath.CollectedVehicles.Add(this);
|
||||
Path.CollectedVehicles.Remove(this);
|
||||
}
|
||||
Driver.Tasks.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue