Skip to content

Commit

Permalink
Fix case issues with ZScript defaults blocks
Browse files Browse the repository at this point in the history
Need to convert names to lowercase since it's case-insensitive

Fix #1038
  • Loading branch information
sirjuddington committed May 6, 2019
1 parent 6aa23f5 commit de5ff4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Game/ZScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,9 @@ bool Class::parseDefaults(vector<ParsedStatement>& defaults)
while (t < count)
{
if (statement.tokens[t] == '+')
default_properties_[statement.tokens[++t]] = true;
default_properties_[statement.tokens[++t].Lower()] = true;
else if (statement.tokens[t] == '-')
default_properties_[statement.tokens[++t]] = false;
default_properties_[statement.tokens[++t].Lower()] = false;
else
break;

Expand All @@ -926,11 +926,11 @@ bool Class::parseDefaults(vector<ParsedStatement>& defaults)
// so stuff like arithmetic expressions or comma separated lists won't
// really work properly yet
if (t + 1 < count)
default_properties_[name] = statement.tokens[t + 1];
default_properties_[name.Lower()] = statement.tokens[t + 1];

// Name only (no value), set as boolean true
else if (t < count)
default_properties_[name] = true;
default_properties_[name.Lower()] = true;
}

return true;
Expand Down

0 comments on commit de5ff4a

Please sign in to comment.