mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-16 15:24:44 +01:00
Show challenge fail screen when a player loses a challenge
This commit is contained in:
@@ -157,6 +157,8 @@ public class ChallengeInstance {
|
||||
default:
|
||||
// Fail challenge
|
||||
this.setStatus(ChallengeStatus.CHALLENGE_FAILED);
|
||||
// Send challenge result data
|
||||
player.sendPacket(new PacketChallengeSettleNotify(this));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package emu.lunarcore.server.packet.send;
|
||||
|
||||
import emu.lunarcore.game.challenge.ChallengeInstance;
|
||||
import emu.lunarcore.proto.ChallengeSettleNotifyOuterClass.ChallengeSettleNotify;
|
||||
import emu.lunarcore.proto.ItemListOuterClass.ItemList;
|
||||
import emu.lunarcore.server.packet.BasePacket;
|
||||
import emu.lunarcore.server.packet.CmdId;
|
||||
|
||||
@@ -14,9 +13,11 @@ public class PacketChallengeSettleNotify extends BasePacket {
|
||||
var data = ChallengeSettleNotify.newInstance()
|
||||
.setChallengeId(challenge.getExcel().getId())
|
||||
.setIsWin(challenge.isWin())
|
||||
.setReward(ItemList.newInstance())
|
||||
.setStars(challenge.getStars());
|
||||
|
||||
// Set empty rewards
|
||||
data.getMutableReward();
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user