Skip to content

Commit

Permalink
Fix bug with conditions being treated as scope
Browse files Browse the repository at this point in the history
  • Loading branch information
herbix committed Nov 25, 2023
1 parent edb9eca commit d622b1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to the "hoi4modutilities" extension will be documented in th

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## Develop

### Fixed
* Fix a bug that some conditions are treated as scope.

## [0.11.1] - 2023/11/17 - Latest

### Fixed
Expand Down
4 changes: 4 additions & 0 deletions src/hoiformat/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export function tryMoveScope(node: Node, scopeStack: Scope[], type: 'condition'
return false;
}

if (typeof node.value !== 'object' || !Array.isArray(node.value)) {
return false;
}

let nodeName = node.name.trim();
if (nodeName.match(/^[A-Z][A-Z0-9]{2}$/)) {
scopeStack.push({
Expand Down

0 comments on commit d622b1d

Please sign in to comment.