diff options
| author | inspectredc <78732756+inspectredc@users.noreply.github.com> | 2024-06-14 14:12:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-14 07:12:39 -0600 |
| commit | 61a621576298eede67ce4be3a91f92bb37e853c1 (patch) | |
| tree | 0a931a29ed44785ebc54e1d54eb49c12350c92e3 /src/factories/sm64/BehaviorScriptFactory.cpp | |
| parent | aa95f29be7b9c7b3190c738e17126ba360b3798c (diff) | |
Fix Script Indenting and GeoLayout BranchAndLink to NULL (#139)
Diffstat (limited to 'src/factories/sm64/BehaviorScriptFactory.cpp')
| -rw-r--r-- | src/factories/sm64/BehaviorScriptFactory.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/factories/sm64/BehaviorScriptFactory.cpp b/src/factories/sm64/BehaviorScriptFactory.cpp index 953b1de..1033676 100644 --- a/src/factories/sm64/BehaviorScriptFactory.cpp +++ b/src/factories/sm64/BehaviorScriptFactory.cpp @@ -29,14 +29,16 @@ ExportResult SM64::BehaviorScriptCodeExporter::Export(std::ostream &write, std:: for(auto& [opcode, arguments] : commands) { bool commaFlag = false; + if (opcode == BehaviorOpcode::END_LOOP || opcode == BehaviorOpcode::END_REPEAT || opcode == BehaviorOpcode::END_REPEAT_CONTINUE) { + --indentCount; + } + for (uint32_t i = 0; i < indentCount; ++i) { write << fourSpaceTab; } if (opcode == BehaviorOpcode::BEGIN_LOOP || opcode == BehaviorOpcode::BEGIN_REPEAT) { ++indentCount; - } else if (opcode == BehaviorOpcode::END_LOOP || opcode == BehaviorOpcode::END_REPEAT || opcode == BehaviorOpcode::END_REPEAT_CONTINUE) { - --indentCount; } write << opcode << "("; |
