Browse Source

differentiate between player loading quest and server preloading all quests

pull/60/head
andy 3 years ago
parent
commit
080e939e56
  1. 2
      src/ship/packet/handler/quest.rs
  2. 2
      src/ship/ship.rs

2
src/ship/packet/handler/quest.rs

@ -68,7 +68,7 @@ pub fn quest_detail(id: ClientId, questdetailrequest: &QuestDetailRequest, quest
Ok(Box::new(vec![(id, SendShipPacket::QuestDetail(qd))].into_iter())) Ok(Box::new(vec![(id, SendShipPacket::QuestDetail(qd))].into_iter()))
} }
pub fn load_quest(id: ClientId, questmenuselect: &QuestMenuSelect, quests: &QuestList, clients: &mut Clients, client_location: &ClientLocation, rooms: &mut Rooms)
pub fn player_chose_quest(id: ClientId, questmenuselect: &QuestMenuSelect, quests: &QuestList, clients: &mut Clients, client_location: &ClientLocation, rooms: &mut Rooms)
-> Result<Box<dyn Iterator<Item = (ClientId, SendShipPacket)> + Send>, ShipError> { -> Result<Box<dyn Iterator<Item = (ClientId, SendShipPacket)> + Send>, ShipError> {
let (_, category_quests) = quests.iter() let (_, category_quests) = quests.iter()
.nth(questmenuselect.category as usize) .nth(questmenuselect.category as usize)

2
src/ship/ship.rs

@ -595,7 +595,7 @@ impl<EG: EntityGateway> ServerState for ShipServerState<EG> {
}, },
RecvShipPacket::QuestMenuSelect(questmenuselect) => { RecvShipPacket::QuestMenuSelect(questmenuselect) => {
let block = self.blocks.with_client(id, &self.clients)?; let block = self.blocks.with_client(id, &self.clients)?;
handler::quest::load_quest(id, questmenuselect, &self.quests, &mut self.clients, &block.client_location, &mut block.rooms)?
handler::quest::player_chose_quest(id, questmenuselect, &self.quests, &mut self.clients, &block.client_location, &mut block.rooms)?
}, },
RecvShipPacket::MenuDetail(_menudetail) => { RecvShipPacket::MenuDetail(_menudetail) => {
//unreachable!(); //unreachable!();

Loading…
Cancel
Save