Open
Description
Expected behaviour
cleanup.fsm should only update alive status of one vehicle.
fn_vehicleUpdate.sqf and fn_vehicleStore.sqf can update more than one vehicle.
Actual behaviour
If two or more vehicles have the same pid and plate both or more vehicles are updated.
Steps to reproduce the behaviour
- Create two vehicles with the same pid and plate.
- Unimpound one vehicle.
- Destroy the vehicle.
- Wait for cleanup.fsm doing its job (normally all 3 minutes).
- Restart server.
- Now both vehicles are deleted from database.
or
- Create two vehicles with the same pid and plate.
- Unimpound one vehicle.
- Add some items to the inventory of the vehicle.
- Check the database: Both vehicles have now the same inventory.
or
- Create two vehicles with the same pid and plate.
- Unimpound one vehicle.
- Damage vehicle.
- Impound vehicle.
- Check the database: Both vehicles have now the same damage.
Solution
Use id instead of combination of pid and plate, as id is the only unique key of vehicles database.
Add id to "dbInfo" variable of vehicle.
Or make sure that plate and pid compination is unique.
Mission version: 5.0.0