Closed fvnkhead closed 2 years ago
I don't know if this behavior is intended or not; anyway, it will be mentioned in the modding docs: https://github.com/R2Northstar/ModdingDocs/pull/39
From a Squirrel perspective a convar doesn't have a type. You can call GetConVarString
and GetConVarInt
on the same convar. I can't speak for how Launcher could / should handle an edge case like this
Isn't this intended behaviour? Either way I don't think this should be changed
A ConVar not having a type is intended behaviour, this crash isn't and should be addressed even if it's very miniscule
I don't have access to an environment to test this at the moment, but i highly suspect the bug is actually not with the mods repo.
As you can see here we call GetString
on the JSON object directly.
Assuming that convarObj
is of type rapidjson::GenericValue
, that method looks like this:
const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return DataString(data_); }
source For any non-string value, the assert will fail and an error will be generated. This will then crash the program. We should either do some error-checking here or use a different method. In either case, I will open a new issue on the launcher about this issue. @GeckoEidechse or @fvnkhead, could you close this issue.
Try with any mod that has a bool value (eg.:
"1"
or"0"
) in convars, and remove the quotes around it.Example: this works fine...
...but if I do this...
...I get this:
Took me a while to debug