From 726a6a92a2b7dde72951fab32e21bd62b8080e42 Mon Sep 17 00:00:00 2001 From: jake Date: Fri, 29 Apr 2022 22:52:23 -0600 Subject: [PATCH] add character_id to ItemNote::PlayerDrop --- src/entity/gateway/postgres/models.rs | 7 +++++-- src/entity/item/mod.rs | 1 + src/ship/items/manager.rs | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/entity/gateway/postgres/models.rs b/src/entity/gateway/postgres/models.rs index e1e8950..f6ab878 100644 --- a/src/entity/gateway/postgres/models.rs +++ b/src/entity/gateway/postgres/models.rs @@ -597,6 +597,7 @@ pub enum PgItemNoteDetail { character_id: u32, }, PlayerDrop { + character_id: u32, map_area: MapArea, x: f32, y: f32, @@ -631,7 +632,8 @@ impl From for PgItemNoteDetail { ItemNote::Pickup{character_id} => PgItemNoteDetail::Pickup { character_id: character_id.0, }, - ItemNote::PlayerDrop{map_area, x, y, z} => PgItemNoteDetail::PlayerDrop { + ItemNote::PlayerDrop{character_id, map_area, x, y, z} => PgItemNoteDetail::PlayerDrop { + character_id: character_id.0, map_area, x,y,z, }, @@ -666,7 +668,8 @@ impl From for ItemNote { PgItemNoteDetail::Pickup{character_id} => ItemNote::Pickup { character_id: CharacterEntityId(character_id as u32), }, - PgItemNoteDetail::PlayerDrop{map_area, x, y, z} => ItemNote::PlayerDrop { + PgItemNoteDetail::PlayerDrop{character_id, map_area, x, y, z} => ItemNote::PlayerDrop { + character_id: CharacterEntityId(character_id as u32), map_area, x,y,z, }, diff --git a/src/entity/item/mod.rs b/src/entity/item/mod.rs index c4d326e..3c43498 100644 --- a/src/entity/item/mod.rs +++ b/src/entity/item/mod.rs @@ -40,6 +40,7 @@ pub enum ItemNote { character_id: CharacterEntityId, }, PlayerDrop { + character_id: CharacterEntityId, map_area: MapArea, x: f32, y: f32, diff --git a/src/ship/items/manager.rs b/src/ship/items/manager.rs index 4019eb2..1d492b4 100644 --- a/src/ship/items/manager.rs +++ b/src/ship/items/manager.rs @@ -497,6 +497,7 @@ impl ItemManager { entity_gateway.add_item_note( &individual_floor_item.entity_id, ItemNote::PlayerDrop { + character_id: character.id, map_area: item_drop_location.0, x: item_drop_location.1, y: item_drop_location.2, @@ -510,6 +511,7 @@ impl ItemManager { entity_gateway.add_item_note( entity_id, ItemNote::PlayerDrop { + character_id: character.id, map_area: item_drop_location.0, x: item_drop_location.1, y: item_drop_location.2, @@ -575,6 +577,7 @@ impl ItemManager { entity_gateway.add_item_note( entity_id, ItemNote::PlayerDrop { + character_id: character.id, map_area: drop_location.map_area, x: drop_location.x, y: 0.0,