wiremod / advduplicator

Garry's Mod add-on that allows a player to save and load contraptions
http://www.wiremod.com
Apache License 2.0
67 stars 43 forks source link

Bug in (de)serialization with E2 includes #82

Open CaptainPRICE opened 5 years ago

CaptainPRICE commented 5 years ago

The following error appears: sv: (lib/whatever)Unknown character found (\) at line 1, char 7

Steps to reproduce:

I have inspected the contents of the dupe (text) file quickly, and it seems like " chars from the main code/file are replaced with £ char, and newline is being replaced via char. But, if you look at the code of the lib/whatever, you will see it didn't make those replacements on #include'd codes, it is seems like it is saving it using string.format("%q", contents_of_included_code). I have tried to manually fix the dupe file, by doing replacements for the included code, but it seems to be non-fixable. There's some bug with how E2 with #includes are being (de)serialized.

Here's the saved dupe file for faster bug reproduce: e2_with_include.txt

CaptainPRICE commented 5 years ago

Probably something has to be fixed in the following file: https://github.com/wiremod/advduplicator/blob/master/lua/autorun/serialiser.lua