copy sonic's position over tails'

This commit is contained in:
Vivian Lim 2020-03-10 02:02:43 -07:00
parent c3c8c91a76
commit f91c9c91f5
1 changed files with 5 additions and 6 deletions

View File

@ -29,6 +29,7 @@ impl From<&mut Sonic2MemoryHandles<'_>> for Sonic2Message {
struct Sonic2MemoryHandles<'a> {
sonic_pos: MemorySliceHandle<'a>,
tails_pos: MemorySliceHandle<'a>,
}
impl SyncableGame for SyncedSonic2 {
@ -61,6 +62,7 @@ impl Sonic2MemoryHandles<'_> {
pub fn create(memory_map: &LibRetroMemoryMap) -> Self {
Sonic2MemoryHandles {
sonic_pos: MemorySliceHandle::create(0xb008, 0x10, 0, memory_map),
tails_pos: MemorySliceHandle::create(0xb048, 0x10, 0, memory_map),
}
}
}
@ -74,15 +76,12 @@ impl SyncedSonic2 {
}
fn handle_message(&mut self, msg: Sonic2Message) -> Result<(), failure::Error> {
/*
match msg.active_pkmn {
match msg.sonic_pos {
Some(src) => {
println!("message contains a new active pokemon. data: {:?}", &src);
self.memory_handles.active_pokemon.write_to_slice(src)
println!("message contains a new sonic pos. writing to tails. {:?}", &src);
self.memory_handles.tails_pos.write_to_slice(src)
}
None => Ok(())
}
*/
Ok(())
}
}