lvl value in level up pkt is 0-based
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
0b641424da
commit
fe472eaae2
@ -59,7 +59,7 @@ where
|
|||||||
let (_, before_stats) = LEVEL_TABLE.get_stats_from_exp(char_class, exp);
|
let (_, before_stats) = LEVEL_TABLE.get_stats_from_exp(char_class, exp);
|
||||||
let (after_level, after_stats) = LEVEL_TABLE.get_stats_from_exp(char_class, exp + exp_gain);
|
let (after_level, after_stats) = LEVEL_TABLE.get_stats_from_exp(char_class, exp + exp_gain);
|
||||||
|
|
||||||
let level_up_pkt = builder::message::character_leveled_up(area_client, after_level, before_stats, after_stats);
|
let level_up_pkt = builder::message::character_leveled_up(area_client, after_level-1, before_stats, after_stats);
|
||||||
exp_pkts.extend(clients_in_area.into_iter()
|
exp_pkts.extend(clients_in_area.into_iter()
|
||||||
.map(move |c| {
|
.map(move |c| {
|
||||||
(c.client, SendShipPacket::Message(Message::new(GameMessage::PlayerLevelUp(level_up_pkt.clone()))))
|
(c.client, SendShipPacket::Message(Message::new(GameMessage::PlayerLevelUp(level_up_pkt.clone()))))
|
||||||
|
@ -81,7 +81,7 @@ async fn test_character_levels_up() {
|
|||||||
last_hitter: 1,
|
last_hitter: 1,
|
||||||
})))).await.unwrap();
|
})))).await.unwrap();
|
||||||
|
|
||||||
assert!(matches!(levelup_pkt[1].1, SendShipPacket::Message(Message {msg: GameMessage::PlayerLevelUp(PlayerLevelUp {lvl: 2, ..})})));
|
assert!(matches!(levelup_pkt[1].1, SendShipPacket::Message(Message {msg: GameMessage::PlayerLevelUp(PlayerLevelUp {lvl: 1, ..})})));
|
||||||
|
|
||||||
let leveltable = CharacterLevelTable::default();
|
let leveltable = CharacterLevelTable::default();
|
||||||
ship.clients.with(ClientId(1), |client| Box::pin(async move {
|
ship.clients.with(ClientId(1), |client| Box::pin(async move {
|
||||||
@ -118,7 +118,7 @@ async fn test_character_levels_up_multiple_times() {
|
|||||||
last_hitter: 1,
|
last_hitter: 1,
|
||||||
})))).await.unwrap();
|
})))).await.unwrap();
|
||||||
|
|
||||||
assert!(matches!(levelup_pkt[1].1, SendShipPacket::Message(Message {msg: GameMessage::PlayerLevelUp(PlayerLevelUp {lvl: 8, ..})})));
|
assert!(matches!(levelup_pkt[1].1, SendShipPacket::Message(Message {msg: GameMessage::PlayerLevelUp(PlayerLevelUp {lvl: 7, ..})})));
|
||||||
|
|
||||||
ship.clients.with(ClientId(1), |client| Box::pin(async move {
|
ship.clients.with(ClientId(1), |client| Box::pin(async move {
|
||||||
assert!(3000 == client.character.exp);
|
assert!(3000 == client.character.exp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user