Stuyk / altv-athena

A Roleplay Framework for alt:V by Stuyk
https://athenaframework.com/
229 stars 149 forks source link

Persistent vehicle spawn doesn't check for duplicate #433

Open lucasmorais99 opened 1 year ago

lucasmorais99 commented 1 year ago

Hello -

When using Athena.vehicle.spawn.persistent(), the underlying code doesn't actually check if the vehicle is already spawned. It uses Athena.document.vehicle.exists(), which checks if a vehicle exists, but not if it is spawned.

Thus, I suggest that line 74 of src/core/server/vehicle/spawn.ts gets changed to: Athena.vehicle.get.spawnedVehicleByDocumentID()

This way, the spawn system actually checks if the vehicle is spawned, rather than if a document exists for it.