altmp / altv-client-js

Official clientside JavaScript runtime for alt:V
6 stars 7 forks source link

Allow float as int native arg #70

Closed LeonMrBonnie closed 3 years ago

LeonMrBonnie commented 3 years ago

Allows passing floats for native arguments that require an int32 or uint32. The float gets truncated to an integer, so the fractional part is lost, but this should be fine because the native doesn't want a float anyway. Also added the same checks in int32 and uint32 to the float arg, as it could also cause a crash