Repository navigation
Fix rental adoption in the collector job - #1
Open
AnthoHansen wants to merge 1 commit into
Open
AnthoHansen wants to merge 1 commit into
AnthoHansen wants to merge 1 commit into
Conversation
- Only live rentals can be adopted. A loop_scooter the server did not rent out (no loopScoot state, or no matching rental) is refused. - A renter can no longer collect their own rental. - Adopted rentals pay Config.Collection.payPerRental (default 0) instead of payPerScooter. - An adopted rental that is dropped, or left in the truck when the shift ends, is removed instead of joining the fleet and respawning at its pickup spot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix rental adoption in the collector job
The collector job could adopt scooters that should not be collectable, and it paid the same as fleet scooters for them. With the default
Config.Price = 0this let players earn money with no limit by collecting their own (or a friend's) free rentals. It also accepted anyloop_scooterspawned by a client.Changes
server/collection.luaadoptable()andserver/main.luaScootRentalCollectable(): only a live rental (a vehicle with theloopScootstate that matches an entry inrentals) can be adopted. Anything else is refused witherr.scooterBusyOrGone.ScootRentalCollectable(): the renter cannot collect their own rental (err.rentalInUse). The guard radius check for other collectors is unchanged.Config.Collection.payPerRental(default0). Adopted rentals are paid at that rate instead ofpayPerScooter. Fleet scooters still paypayPerScooter.payPerRental.No locale keys added (existing messages reused). No client changes.
Testing
Syntax-checked with
luac5.4. Not tested in game yet; suggested checks (Qbox):payPerScooter.payPerRental.