larsiusprime / polymod

Atomic modding framework for Haxe
MIT License
159 stars 60 forks source link

Update PolymodAbstractScriptClass.hx to have "findVar" in resloveField function #174

Open 7oltan opened 1 month ago

7oltan commented 1 month ago

i wanted to add this to help with my code of making safe scriptSet and safe scriptGet (soft coded) which is basically: get variable if it doesnt exist return default value but i cant do that because its not possible to check for a varaible so i added this change

thank you!!

EliteMasterEric commented 1 month ago

Passing a VarDecl outside the hScript class is un-intuitive and risks breaking stuff.

Maybe instead a hasVar function which returns a boolean if findVar is not null would make more sense here?

7oltan commented 1 month ago

Both work, tho I used "findFunction" and it works but idk, the hscript stuff it scares me