Skip to content

Commit 5fabeb4

Browse files
authored
Fix duplicate ends and also update Guilty Gear Xrd Rev2 database (#43)
* Fix duplicate ends and also update Guilty Gear Xrd Rev2 database * add support for codeBlock: EndState
1 parent ef6147b commit 5fabeb4

10 files changed

Lines changed: 1317 additions & 381 deletions

File tree

src/game_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ pub enum CodeBlock {
686686
End,
687687
NoBlock,
688688
BeginNonrecursive,
689+
EndState,
689690
}
690691

691692
impl Default for CodeBlock {

src/parser.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,18 @@ impl ScriptConfig {
9898
if indent > 0 {
9999
last_block_type_valid = false;
100100
indent -= 1;
101-
if indent == 0 {
102-
block_ended = true;
101+
if indent < 1 {
102+
indent = 1;
103103
}
104104
}
105-
}
105+
},
106+
CodeBlock::EndState => {
107+
if indent > 0 {
108+
last_block_type_valid = false;
109+
indent = 0;
110+
block_ended = true;
111+
}
112+
},
106113
_ => {}
107114
}
108115

static_db/bbcf.ron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
1: (
342342
size: 4,
343343
name: "endState",
344-
codeBlock: End,
344+
codeBlock: EndState,
345345
args: [],
346346
),
347347
2: (
@@ -396,7 +396,7 @@
396396
9: (
397397
size: 4,
398398
name: "endSubroutine",
399-
codeBlock: End,
399+
codeBlock: EndState,
400400
args: [],
401401
),
402402
10: (

static_db/dbfz.ron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@
11311131
1: (
11321132
size: 4,
11331133
name: "endState",
1134-
codeBlock: End,
1134+
codeBlock: EndState,
11351135
args: [],
11361136
),
11371137
2: (
@@ -1241,7 +1241,7 @@
12411241
16: (
12421242
size: 4,
12431243
name: "endSubroutine",
1244-
codeBlock: End,
1244+
codeBlock: EndState,
12451245
args: [],
12461246
),
12471247
17: (

static_db/dnf.ron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
),
243243
1: (
244244
name: "endState",
245-
codeBlock: End,
245+
codeBlock: EndState,
246246
args: [
247247
],
248248
),
@@ -279,7 +279,7 @@
279279
),
280280
9: (
281281
name: "endSubroutine",
282-
codeBlock: End,
282+
codeBlock: EndState,
283283
args: [
284284
],
285285
),

static_db/gbvs.ron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
1: (
8282
size: 4,
8383
name: "endState",
84-
codeBlock: End,
84+
codeBlock: EndState,
8585
args: [],
8686
),
8787
2: (
@@ -186,7 +186,7 @@
186186
16: (
187187
size: 4,
188188
name: "endSubroutine",
189-
codeBlock: End,
189+
codeBlock: EndState,
190190
args: [],
191191
),
192192
17: (

static_db/gbvsr.ron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@
581581
1: (
582582
size: 4,
583583
name: "endState",
584-
codeBlock: End,
585584
args: [],
585+
codeBlock: EndState,
586586
),
587587
2: (
588588
size: 40,
@@ -691,8 +691,8 @@
691691
16: (
692692
size: 4,
693693
name: "endSubroutine",
694-
codeBlock: End,
695694
args: [],
695+
codeBlock: EndState,
696696
),
697697
17: (
698698
size: 36,

static_db/ggrev2.ron

Lines changed: 1292 additions & 364 deletions
Large diffs are not rendered by default.

static_db/ggst.ron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@
13501350
1: (
13511351
size: 4,
13521352
name: "endState",
1353-
codeBlock: End,
1353+
codeBlock: EndState,
13541354
args: [],
13551355
),
13561356
2: (
@@ -1460,7 +1460,7 @@
14601460
16: (
14611461
size: 4,
14621462
name: "endSubroutine",
1463-
codeBlock: End,
1463+
codeBlock: EndState,
14641464
args: [],
14651465
),
14661466
17: (

static_db/p4u2.ron

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
1: (
7070
size: 4,
7171
name: "endState",
72-
codeBlock: End,
72+
codeBlock: EndState,
7373
args: [],
7474
),
7575
2: (
@@ -123,7 +123,7 @@
123123
9: (
124124
size: 4,
125125
name: "endSubroutine",
126-
codeBlock: End,
126+
codeBlock: EndState,
127127
args: [],
128128
),
129129
10: (

0 commit comments

Comments
 (0)