Skip to content

Commit

Permalink
Fixed a bug with empty strings in text entries from CSV and lexicon_e…
Browse files Browse the repository at this point in the history
…ntry_add
  • Loading branch information
tabularelf committed Aug 19, 2023
1 parent 8963b2e commit b5f9e3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/__lexicon_parse_csv/__lexicon_parse_csv.gml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ for(var _j = 1; _j < _height; ++_j) {
if (_array[_i][0] == LEXICON_ROW_SEPERATOR) continue;
var _entry = _array[_i][_j];
var _textPointer = _array[_i][0]
if (_textPointer == "") continue; // Skipping any and all blank entries
if ((LEXICON_REPLACE_ENTRIES) && (variable_struct_exists(__LEXICON_STRUCT.textEntries, _textPointer))) {
lexicon_entry_add(_textPointer, _entry);
} else if (!variable_struct_exists(__LEXICON_STRUCT.textEntries, _textPointer)) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/lexicon_entry_add/lexicon_entry_add.gml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/// @param {String} string
/// feather ignore all
function lexicon_entry_add(_textEntry, _string) {
if ((!LEXICON_REPLACE_ENTRIES) && (variable_struct_exists(__LEXICON_STRUCT.textEntries, _textEntry))) exit;
if (_textEntry == "") __lexicon_throw("textEntry shouldn't be a blank string in lexicon_entry_add!");
if ((!LEXICON_REPLACE_ENTRIES) && (variable_struct_exists(__LEXICON_STRUCT.textEntries, _textEntry))) return undefined;
__LEXICON_STRUCT.textEntries[$ _textEntry] = _string;
}

0 comments on commit b5f9e3c

Please sign in to comment.