multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.42k stars 438 forks source link

getVehicleMaxPassengers returns false instead of 0 for obscure trailer vehicles #2907

Open Dark-Dragon opened 1 year ago

Dark-Dragon commented 1 year ago

Describe the bug

Given a valid vehicle getVehicleMaxPassengers is supposed to return an integer, however for some obscure vehicle IDs (for example 610 and 611) it returns false instead. They're definitely vehicle type elements though and can even be driven if you warp someone in the driver seat, so getVehicleMaxPassengers should simply return 0 for them.

Steps to reproduce

run outputChatBox( tostring ( getVehicleMaxPassengers ( createVehicle(611,0,0,3) ) ) )

Version

Client: Multi Theft Auto v1.5.9-release-21554 (Windows 10, 64 bit) Server: MTA:SA Server v1.5.9-release-21554 (Windows 10, 64 bit)

Additional context

Attempting to warp someone in a passenger seat currently results in larger issues #2906

Relevant log output

No response

Security Policy

TracerDS commented 1 year ago

Its because you cant drive a trailer directly. These IDs are not drive-able:

Dark-Dragon commented 1 year ago

Its because you cant drive a trailer directly. These IDs are not drive-able:

  • 435
  • 450
  • 569
  • 584
  • 590
  • 591
  • 606
  • 607
  • 608
  • 610
  • 611

All of those can be driven.

TracerDS commented 1 year ago

Not directly. WarpPedToVehicle forces you to drive a vehicle but that doesnt mean that vehicle is drive-able

Dark-Dragon commented 1 year ago

Care to explain, then? And why does it matter if it's causing bugs either way?

TracerDS commented 1 year ago

Well, this function itself is not causing bugs. Sure, there should be a note about returning false if the modelID is... invalid.

Yes, it doesnt matter what id WarpPedToVehicle will receive but thats a, separate issue