Skip to content

Commit

Permalink
Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Mentrillum committed Nov 8, 2023
1 parent 712260f commit ad28126
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,10 @@ private void rewriteButton_Click(object sender, EventArgs e)
else
{
index = kv.GetSectionIndex("animations");
if (index == -1)
{
index = kv.GetKeyIndex("cloak_enable");
}
InsertKeyValue(ref globalLine, ref index, "\"postures\"");
InsertKeyValue(ref globalLine, ref index, "{");

Expand Down Expand Up @@ -1999,6 +2003,10 @@ private void rewriteButton_Click(object sender, EventArgs e)
else
{
index = kv.GetSectionIndex("animations");
if (index == -1)
{
index = kv.GetKeyIndex("crawling_enabled");
}
InsertKeyValue(ref globalLine, ref index, "\"postures\"");
InsertKeyValue(ref globalLine, ref index, "{");

Expand Down
4 changes: 4 additions & 0 deletions scripting/KeyValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,10 @@ public int GetSectionIndex(string name)
do
{
index = this.Root.Peek().Keys[0].IndexOf(name);
if (index == -1)
{
return -1;
}
}
while (!this.Root.Peek().IsSection[index]);
index = this.Root.Peek().Indexes[index];
Expand Down

0 comments on commit ad28126

Please sign in to comment.