L0laapk3 / FactorioMaps

L0laapk3's FactorioMaps mod
https://mods.factorio.com/mod/L0laapk3_FactorioMaps
Other
118 stars 22 forks source link

Script crashes on text label that contains "'s #113

Closed isomer closed 9 months ago

isomer commented 1 year ago
[GAME]   86.106 Error AppManagerStates.cpp:1595: __L0laapk3_FactorioMaps__/control.lua:5: __L0laapk3_FactorioMaps__/autorun.lua:13: '}' expected near 'Disposal'           
stack traceback:                                                                                                                                                           
        [C]: in function 'require'                                                                                                                                                
        __L0laapk3_FactorioMaps__/control.lua:5: in main chunk              

Which appears to be because:

 ["text"] =  "Flue Gas "Disposal""
            mapInfoLua = re.sub(r'"([^"]+)" *:', lambda m: '["'+m.group(1)+'"] = ', f.read().replace("[", "{").replace("]", "}"))

I think we need a more robust way to convert from json to lua.

L0laapk3 commented 9 months ago

I totally agree, but I'm going with the lazy road for now and making my messy hack more messy instead. If its any consolation I have tested the following tags: image