openplanet-nl / issues

Issue tracker for Openplanet.
10 stars 0 forks source link

string::SubStr and wstring::SubStr have different behaviors #406

Closed XertroV closed 6 months ago

XertroV commented 9 months ago

I was doing string(folder.FullDirName.SubStr(7)) as a way to get the extract directory of a FidsFolder with a path like: <fake>\MemoryTemp\CurrentMap_EmbeddedFiles\ContentLoaded\Items\z983-waypoint_stickers_2022\waypoint_stickers_2022_1XL\waypoint_stickers_6_1XL\.

Unexpectedly, I'd get an empty string (probably because of the length argument)

However, string(folder.FullDirName).SubStr(7) works fine.

Not sure if this is a Nadeo thing or an Openplanet thing, but it'd be better if they both worked the same IMO.

codecat commented 8 months ago

Was this on Maniaplanet/Turbo or on TM? On TM, string and wstring are identical internally, they just have a slightly different API. But they should have the exact same behavior on substr.

XertroV commented 8 months ago

tm2020

XertroV commented 8 months ago

I think it makes sense given these API differences.

image image