larsiusprime / polymod

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

[BUG] `extensionMap` parameter does not work #159

Closed gamerbross closed 1 year ago

gamerbross commented 1 year ago

I tried using the extensionMap parameter when starting Polymod, and it doesn't work.

It doesn't work because when instantiating PolymodAssetLibrary, the extensions variable is equal to params.extensionMap, which can be (and usually is) null and then, when setting the default extensions, the value of extensions is overwritten leaving totally ignore the previous value regardless if it is null or not.

It can be fixed by simply adding an if statement, that checks if it's null, before overriding the variable.

(line 398)

if (extensions == null)
    extensions = new Map<String, PolymodAssetType>();

I hope I can help. =)

UPDATE

I fixed this issue in this pull request: #162