Browse Source

add character_id to ItemNote::PlayerDrop

pull/113/head
jake 3 years ago
parent
commit
12fd799278
  1. 7
      src/entity/gateway/postgres/models.rs
  2. 1
      src/entity/item/mod.rs
  3. 3
      src/ship/items/manager.rs

7
src/entity/gateway/postgres/models.rs

@ -591,6 +591,7 @@ pub enum PgItemNoteDetail {
character_id: u32,
},
PlayerDrop {
character_id: u32,
map_area: MapArea,
x: f32,
y: f32,
@ -625,7 +626,8 @@ impl From<ItemNote> 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,
},
@ -660,7 +662,8 @@ impl From<PgItemNoteDetail> 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,
},

1
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,

3
src/ship/items/manager.rs

@ -492,6 +492,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,
@ -505,6 +506,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,
@ -570,6 +572,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,

Loading…
Cancel
Save