Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlimited Fuel with caravans #17

Open
codexhound opened this issue Nov 8, 2017 · 0 comments
Open

Unlimited Fuel with caravans #17

codexhound opened this issue Nov 8, 2017 · 0 comments

Comments

@codexhound
Copy link

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant