Skip to content

Commit

Permalink
part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryFrosty authored Sep 7, 2024
1 parent f58923d commit 008a100
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1449,8 +1449,9 @@ class PlayState extends MusicBeatState
}

function eventEarlyTrigger(event:EventNote):Float {
var returnedValue:Null<Float> = callOnScripts('eventEarlyTrigger', [event.event, event.value1, event.value2, event.strumTime], true, [], [0]);
if(returnedValue != null && returnedValue != 0 && returnedValue != LuaUtils.Function_Continue) {
var returnedValue:Dynamic = callOnScripts('eventEarlyTrigger', [event.event, event.value1, event.value2, event.strumTime], true, [], [0]);
returnedValue = Std.parseFloat(returnedValue);
if(!Math.isNaN(returnedValue) && returnedValue != 0) {
return returnedValue;
}

Expand Down Expand Up @@ -3275,7 +3276,7 @@ class PlayState extends MusicBeatState
#end

public function callOnScripts(funcToCall:String, args:Array<Dynamic> = null, ignoreStops = false, exclusions:Array<String> = null, excludeValues:Array<Dynamic> = null):Dynamic {
var returnVal:Dynamic = LuaUtils.Function_Continue;
var returnVal:String = LuaUtils.Function_Continue;
if(args == null) args = [];
if(exclusions == null) exclusions = [];
if(excludeValues == null) excludeValues = [LuaUtils.Function_Continue];
Expand All @@ -3286,7 +3287,7 @@ class PlayState extends MusicBeatState
}

public function callOnLuas(funcToCall:String, args:Array<Dynamic> = null, ignoreStops = false, exclusions:Array<String> = null, excludeValues:Array<Dynamic> = null):Dynamic {
var returnVal:Dynamic = LuaUtils.Function_Continue;
var returnVal:String = LuaUtils.Function_Continue;
#if LUA_ALLOWED
if(args == null) args = [];
if(exclusions == null) exclusions = [];
Expand Down Expand Up @@ -3325,7 +3326,7 @@ class PlayState extends MusicBeatState
}

public function callOnHScript(funcToCall:String, args:Array<Dynamic> = null, ?ignoreStops:Bool = false, exclusions:Array<String> = null, excludeValues:Array<Dynamic> = null):Dynamic {
var returnVal:Dynamic = LuaUtils.Function_Continue;
var returnVal:String = LuaUtils.Function_Continue;

#if HSCRIPT_ALLOWED
if(exclusions == null) exclusions = new Array();
Expand All @@ -3347,10 +3348,7 @@ class PlayState extends MusicBeatState
var callValue = script.call(funcToCall, args);
var myValue:Dynamic = callValue.methodVal;

// compiler fuckup fix
final stopHscript = myValue == LuaUtils.Function_StopHScript;
final stopAll = myValue == LuaUtils.Function_StopAll;
if((stopHscript || stopAll) && !excludeValues.contains(myValue) && !ignoreStops)
if((myValue == LuaUtils.Function_StopHScript || myValue == LuaUtils.Function_StopAll) && !excludeValues.contains(myValue) && !ignoreStops)
{
returnVal = myValue;
break;
Expand Down

0 comments on commit 008a100

Please sign in to comment.