Skip to content

Commit 949ac78

Browse files
original bytes in some formats
1 parent 3dc276a commit 949ac78

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

packages/pokemon-files/src/pkm/PA8.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ export default class PA8 {
103103
isNoble: boolean
104104
ribbons: string[]
105105
trainerGender: boolean
106+
originalBytes?: ArrayBuffer
106107
constructor(arg: ArrayBuffer | AllPKMFields, encrypted?: boolean) {
107108
if (arg instanceof ArrayBuffer) {
108109
let buffer = arg
110+
this.originalBytes = buffer
109111
if (encrypted) {
110112
const unencryptedBytes = encryption.decryptByteArrayGen8A(buffer)
111113
const unshuffledBytes = encryption.unshuffleBlocksGen8A(unencryptedBytes)

packages/pokemon-files/src/pkm/PA9.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ export default class PA9 {
9393
tmFlagsLza: Uint8Array
9494
ribbons: string[]
9595
trainerGender: boolean
96+
originalBytes?: ArrayBuffer
9697
constructor(arg: ArrayBuffer | AllPKMFields, encrypted?: boolean) {
9798
if (arg instanceof ArrayBuffer) {
9899
let buffer = arg
100+
this.originalBytes = buffer
99101
if (encrypted) {
100102
const unencryptedBytes = encryption.decryptByteArrayGen89(buffer)
101103
const unshuffledBytes = encryption.unshuffleBlocksGen89(unencryptedBytes)

src/core/save/cfru/PK3CFRU.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ export abstract class PK3CFRU implements PluginPKMInterface {
121121
constructor(arg: ArrayBuffer | OHPKM) {
122122
if (arg instanceof ArrayBuffer) {
123123
let buffer = arg
124+
this.originalBytes = buffer
124125
const dataView = new DataView(buffer)
125126

126-
this.originalBytes = arg
127-
128127
// https://github.com/Skeli789/Complete-Fire-Red-Upgrade/blob/master/include/new/pokemon_storage_system.h
129128
// https://github.com/Skeli789/Complete-Fire-Red-Upgrade/blob/master/include/pokemon.h
130129

0 commit comments

Comments
 (0)