Adding modding folder with a hacked build.

This commit is contained in:
ml
2026-09-26 08:53:08 +02:00
parent cdb960dc71
commit c91080aba7
755 changed files with 50424 additions and 0 deletions
@@ -0,0 +1,28 @@
package archive
import (
"io/ioutil"
"github.com/inkyblackness/hacked/ss1/resource"
)
// IsSavegame returns true for resources that most likely identify a savegame.
// This function must be called with a resource from ID 0x0FA1.
func IsSavegame(res resource.BlockProvider) bool {
if res == nil {
return false
}
if res.BlockCount() < 1 {
return false
}
dataReader, err := res.Block(0)
if err != nil {
return false
}
data, err := ioutil.ReadAll(dataReader)
if err != nil {
return false
}
state := NewGameState(data)
return state.IsSavegame()
}