let scripts require from the same mod (#1698)

it seems fine to have
`require("mymod/script")`
e.g. if mods require a lot of scripts and want to organise it
This commit is contained in:
DeltaNedas 2020-03-26 22:30:34 +00:00 committed by GitHub
parent 935b22bf4a
commit b077cd7fb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,7 +122,7 @@ public class Scripts implements Disposable{
if(matched.find()){
LoadedMod required = Vars.mods.locateMod(matched.group(1));
String script = matched.group(2);
if(required == null || root.equals(required.root.child("scripts"))){ // Mod not found, or already using a mod
if(required == null){ // Mod not found, treat it as a folder
Fi dir = root.child(matched.group(1));
if(!dir.exists()) return null; // Mod and folder not found
return loadSource(script, dir, validator);