mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-23 18:17:32 +00:00
Fix bug causing unserialize failed
This commit is contained in:
parent
c9537ae182
commit
7743aee281
1 changed files with 3 additions and 0 deletions
|
|
@ -470,6 +470,9 @@ func serialize(size uint) ([]byte, error) {
|
|||
|
||||
// unserialize unserializes internal state from a byte slice.
|
||||
func unserialize(bytes []byte, size uint) error {
|
||||
if len(bytes) == 0 {
|
||||
return nil
|
||||
}
|
||||
ok := bool(C.bridge_retro_unserialize(retroUnserialize, unsafe.Pointer(&bytes[0]), C.size_t(size)))
|
||||
if !ok {
|
||||
return errors.New("retro_unserialize failed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue