-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Found an issue with vehicles. They have unlimited fuel when in a caravan (world view). The code to look at is here in CompVehicle.cs
//If it isn't moving than it shouldn't use fuel
if ((this.Pawn.pather != null && !this.Pawn.pather.Moving) || (this.Pawn.GetCaravan() != null && (this.Pawn.GetCaravan().CantMove)))
compRefuelable.Props.fuelConsumptionRate = 0f;
else
//If it's moving than it should use fuel
compRefuelable.Props.fuelConsumptionRate = this.fuelConsumptionRate;
Change to something like this to fix:
if ((this.Pawn.pather != null && this.Pawn.pather.Moving))
compRefuelable.Props.fuelConsumptionRate = this.fuelConsumptionRate;
else if((this.Pawn.GetCaravan() != null && !this.Pawn.GetCaravan().Resting) && (this.Pawn.GetCaravan() != null && !this.Pawn.GetCaravan().CantMove))
compRefuelable.Props.fuelConsumptionRate = this.fuelConsumptionRate;
else //If it isn't moving than it shouldn't use fuel
compRefuelable.Props.fuelConsumptionRate = 0f;
Metadata
Metadata
Assignees
Labels
No labels