Skip to content

Commit

Permalink
Revert JoinedLuaVariables.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolka9144 authored Dec 25, 2024
1 parent ca63f0c commit 556b3e8
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions source/mikolka/JoinedLuaVariables.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,8 @@ class JoinedLuaVariables extends StringMap<Dynamic> {
}
override function get(key:String):Null<Dynamic> {
//! P-Slice patch
var regex = ~/(.+)\[([0-9]+)\]/;
if(regex.match(key)){
var realKey = regex.matched(1);
var index = Std.parseInt(regex.matched(2));
var arrayValue = super.get(realKey);
if(arrayValue == null) arrayValue = resolveUnknown(realKey);
return arrayValue[index];
}
var arrayValue = super.get(key);
if(arrayValue == null) arrayValue = resolveUnknown(key);
if(arrayValue == null) arrayValue = LuaUtils.getVarInArray(PlayState.instance, key, false);
return arrayValue;
}
private inline function resolveUnknown(key:String):Null<Dynamic> {
return LuaUtils.getVarInArray(PlayState.instance, key, false);
}
}
}

0 comments on commit 556b3e8

Please sign in to comment.