fortressforever-2013 / fortressforever-src

A port of Fortress Forever, a Team Fortress mod on Source Engine SDK 2013 (SDK2013CE)
https://www.fortress-forever.com/
Other
6 stars 6 forks source link

[LUA] Functions accepting integers don't accept float anymore #6

Closed YoYo178 closed 8 months ago

YoYo178 commented 8 months ago

Previously with Luabind, functions that accepted an integer value also accepted float values on integer fields from LUA. LuaBridge3 seems to be having strict type checks which prevents the Luabind scenario. (a float value on an integer field errors, but an integer value on a float value doesn't) ff_training's LUA script seems to be affected by this issue. (works right now because of SimulateFloat workaround) Possible fix - convert all the functions exposed to LUA with integer parameters to float (but only those where a float value is expected to be passed, examples include hud related functions like AddHudIcon) (maybe even improve the functions further that are called by the LUA function to accept float values so the hud functions can have more precision)