js: Bug in case sensitivity in globals

For AI and campaign script related discussions and questions
Post Reply
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

js: Bug in case sensitivity in globals

Post by Per »

Javascript is supposed to be case sensitive. However, since the key value in the ini file format is case insensitive, and we use the variable name as key when saving, any variable used in global must be case insensitive for now. Otherwise variables will get wrong values when loaded from a savegame. There is no need to be case insensitive in regards to variables defined by the c++ code, only internally to your own script.

I will fix this problem later. For now, just be aware of the problem.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: js: Bug in case sensitivity in globals

Post by aubergine »

There's also an issue with save games containing non-configurable global and object properties. For example, all the game constants, and things like "me" are getting in to save game files.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: js: Bug in case sensitivity in globals

Post by Per »

I have removed all the predefined globals, except 'me', from the savegames now. Should look more tidy.
Post Reply