Use CopyMovesetTo/FromStream in other funcs

This commit is contained in:
Chesyon 2026-05-06 12:48:33 -04:00
parent 6e91cff71e
commit 6e3da4378a
2 changed files with 4 additions and 6 deletions

View File

@ -1,13 +1,12 @@
#include "main_02059334.h"
#include "save.h"
#include "main_02014A4C.h"
extern void CopyBitsTo(void *ctx, void *src, s32 nbits);
extern void Copy16BitsTo(void *stream, void *buf_write);
extern void CopyMovesetToStream(struct bitstream *stream, void *buffer_write);
extern void* memset(void *s, s32 c, u32 n);
extern void CopyBitsFrom(void *stream, void *buf_read, s32 nbits);
extern void Copy16BitsFrom(void *stream, void *buf_read);
extern void CopyMovesetFromStream(struct bitstream *stream, void *dst);
void WriteMonsterToSave(struct bitstream *stream, struct ground_monster *monster)
{
@ -26,7 +25,7 @@ void WriteMonsterToSave(struct bitstream *stream, struct ground_monster *monster
CopyBitsTo(stream, &monster->exp, 24);
CopyBitsTo(stream, &monster->iq_skill_flags, 69);
CopyBitsTo(stream, &monster->tactic, 4);
CopyMovesetToStream(stream, &monster->moves);
CopyMovesetToStream(stream, (struct ground_move*)&monster->moves);
CopyBitsTo(stream, &monster->name, 80);
}
@ -48,6 +47,6 @@ void ReadMonsterFromSave(struct bitstream *stream, struct ground_monster *monste
CopyBitsFrom(stream, &monster->exp, 24);
CopyBitsFrom(stream, &monster->iq_skill_flags, 69);
CopyBitsFrom(stream, &monster->tactic, 4);
CopyMovesetFromStream(stream, &monster->moves);
CopyMovesetFromStream(stream, (struct ground_move*)&monster->moves);
CopyBitsFrom(stream, &monster->name, 80);
}

View File

@ -2,6 +2,7 @@
#include "common.h"
#include "save.h"
#include "main_0200224C.h"
#include "main_02014A4C.h"
#include "main_02059A74.h"
#include "main_0205B690.h"
#include "main_0205C440.h"
@ -13,13 +14,11 @@ extern void InitBitstreamForWrite(struct bitstream *stream, u32 v1, u32 v2);
extern void CopyBitsFrom(struct bitstream *stream, void *buf_read, s32 nbits);
extern void* memset(void *s, s32 c, u32 n);
extern void Copy16BitsFrom(struct bitstream *stream, void *buf_read);
extern void CopyMovesetFromStream(struct bitstream *stream, void *dst);
extern void BitstreamDebug(struct bitstream *stream);
extern void sub_020634F4(void);
extern void InitBitstreamForRead(struct bitstream *stream, u32 p1, u32 p2);
extern void CopyBitsTo(struct bitstream *stream, void* buf_write, s32 nbits);
extern void Copy16BitsTo(struct bitstream *stream, void *buf_write);
extern void CopyMovesetToStream(struct bitstream *stream, void *buffer_write);
void sub_0205BD14(u32 *dest, s32 index)
{