Skip to content

Commit

Permalink
bevy 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
ironpeak committed Oct 29, 2024
1 parent 6d407bf commit ca56606
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/core/event_registry/client_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub trait ClientEventAppExt {
event: &ReflectEvent,
cursor: &mut Cursor<Vec<u8>>,
) -> bincode::Result<()> {
let serializer = ReflectSerializer::new(&*event.0, ctx.registry);
let serializer = ReflectSerializer::new(&*event.0.as_partial_reflect(), ctx.registry);
DefaultOptions::new().serialize_into(cursor, &serializer)
}
Expand All @@ -106,11 +106,11 @@ pub trait ClientEventAppExt {
) -> bincode::Result<ReflectEvent> {
let mut deserializer = bincode::Deserializer::with_reader(cursor, DefaultOptions::new());
let reflect = ReflectDeserializer::new(ctx.registry).deserialize(&mut deserializer)?;
Ok(ReflectEvent(reflect))
Ok(ReflectEvent(reflect.try_into_reflect().unwrap()))
}
#[derive(Event)]
struct ReflectEvent(Box<dyn PartialReflect>);
struct ReflectEvent(Box<dyn Reflect>);
```
*/
fn add_client_event_with<E: Event>(
Expand Down
6 changes: 3 additions & 3 deletions src/core/event_registry/server_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub trait ServerEventAppExt {
event: &ReflectEvent,
cursor: &mut Cursor<Vec<u8>>,
) -> bincode::Result<()> {
let serializer = ReflectSerializer::new(&*event.0, ctx.registry);
let serializer = ReflectSerializer::new(&*event.0.as_partial_reflect(), ctx.registry);
DefaultOptions::new().serialize_into(cursor, &serializer)
}
Expand All @@ -113,11 +113,11 @@ pub trait ServerEventAppExt {
) -> bincode::Result<ReflectEvent> {
let mut deserializer = bincode::Deserializer::with_reader(cursor, DefaultOptions::new());
let reflect = ReflectDeserializer ::new(ctx.registry).deserialize(&mut deserializer)?;
Ok(ReflectEvent(reflect))
Ok(ReflectEvent(reflect.try_into_reflect().unwrap()))
}
#[derive(Event)]
struct ReflectEvent(Box<dyn PartialReflect>);
struct ReflectEvent(Box<dyn Reflect>);
```
*/
fn add_server_event_with<E: Event>(
Expand Down

0 comments on commit ca56606

Please sign in to comment.