Mike's Cops and Robbers

Community => Bug Reports => Fixed Bugs => Topic started by: Treba on July 25, 2019, 10:18:31 pm

Title: Weird situation spawning a personal vehicle
Post by: Treba on July 25, 2019, 10:18:31 pm
I came ingame, ordered a personal car, headed to it and got questioned by my arrival. The text above my car stated that was "Sadler" available for a test drive. I entered it and got my car and character teleported to the dealership. The next moment I was messaged that my car had been returned to my garage.
It hasn't repeated anymore but I think that situation needs to be explored.

(https://i.imgur.com/96t50lb.png)
(https://i.imgur.com/yyLZX5F.png)
(https://i.imgur.com/p1JB5CW.png)
Title: Re: Weird situation spawning a personal vehicle
Post by: Mike on July 25, 2019, 10:21:51 pm
This is a known issue with other vehicles, and is under investigation. Sorry about this.
Title: Re: Weird situation spawning a personal vehicle
Post by: Mike on July 27, 2019, 12:36:50 am
Something happens during the course of the server being online for a long time whereby the dealership test drive vehicles somehow get destroyed. What then happens is you request a personal vehicle and it takes the vehicle ID that the destroyed test drive vehicle had. The server will think it is a test drive vehicle.

One course of action would be to detect when a test drive vehicle is destroyed and no longer store that vehicle ID as being a test drive vehicle. But the issue would still remain that test drive vehicles should not be getting destroyed except for city change.

I need to find out which part of the script is destroying them.
Title: Re: Weird situation spawning a personal vehicle
Post by: Treba on July 27, 2019, 02:56:01 pm
Something happens during the course of the server being online for a long time whereby the dealership test drive vehicles somehow get destroyed. What then happens is you request a personal vehicle and it takes the vehicle ID that the destroyed test drive vehicle had. The server will think it is a test drive vehicle.

One course of action would be to detect when a test drive vehicle is destroyed and no longer store that vehicle ID as being a test drive vehicle. But the issue would still remain that test drive vehicles should not be getting destroyed except for city change.

I need to find out which part of the script is destroying them.

Probably in OnPlayerExitVehicle
Title: Re: Weird situation spawning a personal vehicle
Post by: Mike on September 24, 2019, 09:27:09 am
I have been meaning to fix this for a while. I am 99% certain this is caused by the fact that all vehicles on the server are destroyed on city change, but some things 'carry over' from the previous city's vehicles. Two things were not 'reset' when a vehicle is destroyed, which could affect how the vehicle is treated on the next city. This has been fixed which may resolve this issue. I have debug logs which tell me when a dealership vehicle was wrongly destroyed and why, and most of them are from a 'static vehicle respawning' but they are not static vehicles. I think the vehicle IDs were static vehicle IDs in the last city.

I will keep an eye on the logs as the static vehicle respawn is not the only reason it reports.

Another issue was that when the dealership test drive ended/failed, it would destroy your current vehicle and your 'last' vehicle (which would be your current vehicle if things go right). It now explicitly remembers the vehicle which is soley created for the test drive and will only destroy that.