From 8bf495f5c0c6b35568566203f76cf8eb2801af9c Mon Sep 17 00:00:00 2001 From: knoxfighter Date: Wed, 18 Jul 2018 04:27:14 +0200 Subject: [PATCH] added mickael9 to the ReadMe --- README.md | 3 +++ src/vendor/factorioSave/factorioSave.go | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3f73baa..02a7712 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,9 @@ go build * **Mitch Roote** - [roote.ca](https://roote.ca) +## Special Thanks +- **mickael9** for reverseengineering the factorio-save-file: https://forums.factorio.com/viewtopic.php?f=5&t=8568# + ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details diff --git a/src/vendor/factorioSave/factorioSave.go b/src/vendor/factorioSave/factorioSave.go index 19e6138..b258575 100644 --- a/src/vendor/factorioSave/factorioSave.go +++ b/src/vendor/factorioSave/factorioSave.go @@ -50,13 +50,13 @@ type singleMod struct { var ErrorIncompatible = errors.New("incompatible save") var data Header -var constraintGreaterThan0_16 *semver.Constraints +var constraintGreaterThan016 *semver.Constraints func ReadHeader(filePath string) (Header, error) { var err error data = Header{} - constraintGreaterThan0_16, _ = semver.NewConstraint(">= 0.16.0") + constraintGreaterThan016, _ = semver.NewConstraint(">= 0.16.0") datFile, err := openSave(filePath) if err != nil { @@ -143,7 +143,7 @@ func ReadHeader(filePath string) (Header, error) { return data, err } - Used, err := data.FactorioVersion.CheckCompatibility(constraintGreaterThan0_16) + Used, err := data.FactorioVersion.CheckCompatibility(constraintGreaterThan016) if err != nil { log.Printf("Error checking if used: %s", err) return data, err @@ -174,7 +174,7 @@ func ReadHeader(filePath string) (Header, error) { return data, err } - New, err := data.FactorioVersion.CheckCompatibility(constraintGreaterThan0_16) + New, err := data.FactorioVersion.CheckCompatibility(constraintGreaterThan016) if err != nil { log.Printf("error checking compatibility: %s", err) return data, err @@ -208,7 +208,7 @@ func ReadHeader(filePath string) (Header, error) { func readUTF8String(file io.ReadCloser, forcedOptim bool) (string, error) { var err error - New, err := data.FactorioVersion.CheckCompatibility(constraintGreaterThan0_16) + New, err := data.FactorioVersion.CheckCompatibility(constraintGreaterThan016) if err != nil { log.Printf("Couldn't checkCompatibility: %s", err) return "", err