YSI-Includes icon indicating copy to clipboard operation
YSI-Includes copied to clipboard

Vehicle_Name with the format functions

Open C-far opened this issue 7 years ago • 3 comments

The macro Vehicle_Name (and maybe others, I didn't test) doesn't work with a format function.

print(Vehicle_Name(vehid));
printf("%s", Vehicle_Name(vehid));
printf("%s (%d)", Vehicle_Name(vehid), vehid);

Test with the vehicleid 1 (Landstalker) and the vehicleid 2 (NRG-500) :

[15:31:25] Landstalker
[15:31:25] dl
[15:31:25] dl
[15:31:25] NRG-500
[15:31:25] -
[15:31:25] -

C-far avatar Aug 12 '18 13:08 C-far

You might need to unpack the value first

Misiur avatar Aug 12 '18 13:08 Misiur

Oh my bad :(

C-far avatar Aug 12 '18 15:08 C-far

They should work in those cases though, even if there is a fix here. YSI does have a convenience function for unpacking though:

printf("%s", unpack(Vehicle_Name(vehid)));

Y-Less avatar Aug 12 '18 15:08 Y-Less