|
@@ -3,6 +3,7 @@ package gen7
|
|
|
import (
|
|
import (
|
|
|
"bytes"
|
|
"bytes"
|
|
|
"encoding/binary"
|
|
"encoding/binary"
|
|
|
|
|
+ "errors"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"strings"
|
|
"strings"
|
|
|
"time"
|
|
"time"
|
|
@@ -185,11 +186,11 @@ func validateRawPokemon(rawPokemon p.RawPokemon) error {
|
|
|
|
|
|
|
|
checksumValue := toUint16(rawPokemon[0x06:0x08])
|
|
checksumValue := toUint16(rawPokemon[0x06:0x08])
|
|
|
if calculatedChecksum := calculateChecksum(rawPokemon); calculatedChecksum != checksumValue {
|
|
if calculatedChecksum := calculateChecksum(rawPokemon); calculatedChecksum != checksumValue {
|
|
|
- return fmt.Errorf("Invalid checksum for generation 7 pokemon")
|
|
|
|
|
|
|
+ return errors.New("Invalid checksum for generation 7 pokemon")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if toUint16(rawPokemon[0x04:0x06]) == 1 || rawPokemon[0x58] == 1 || rawPokemon[0x90] == 1 || rawPokemon[0xc8] == 1 {
|
|
if toUint16(rawPokemon[0x04:0x06]) == 1 || rawPokemon[0x58] == 1 || rawPokemon[0x90] == 1 || rawPokemon[0xc8] == 1 {
|
|
|
- return fmt.Errorf("Invalid bytes supplied for generation 7 pokemon")
|
|
|
|
|
|
|
+ return errors.New("Invalid bytes supplied for generation 7 pokemon")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
return nil
|