mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-09 17:53:17 +08:00
parent
c517b8a2c9
commit
d9f85ba2a7
@ -624,6 +624,8 @@ public class Avatar {
|
|||||||
|
|
||||||
public void calcConstellation(OpenConfigEntry entry, boolean notifyClient) {
|
public void calcConstellation(OpenConfigEntry entry, boolean notifyClient) {
|
||||||
if (entry == null) return;
|
if (entry == null) return;
|
||||||
|
if (this.getPlayer() == null)
|
||||||
|
notifyClient = false;
|
||||||
|
|
||||||
// Check if new constellation adds +3 to a skill level
|
// Check if new constellation adds +3 to a skill level
|
||||||
if (this.calcConstellationExtraLevels(entry) && notifyClient) {
|
if (this.calcConstellationExtraLevels(entry) && notifyClient) {
|
||||||
@ -754,9 +756,10 @@ public class Avatar {
|
|||||||
// Get talent
|
// Get talent
|
||||||
AvatarTalentData talentData = GameData.getAvatarTalentDataMap().get(talentId);
|
AvatarTalentData talentData = GameData.getAvatarTalentDataMap().get(talentId);
|
||||||
if (talentData == null) return false;
|
if (talentData == null) return false;
|
||||||
|
var player = this.getPlayer();
|
||||||
|
|
||||||
// Pay constellation item if possible
|
// Pay constellation item if possible
|
||||||
if (!skipPayment && !this.getPlayer().getInventory().payItem(talentData.getMainCostItemId(), 1)) {
|
if (!skipPayment && (player != null) && !player.getInventory().payItem(talentData.getMainCostItemId(), 1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -764,8 +767,10 @@ public class Avatar {
|
|||||||
this.talentIdList.add(talentData.getId());
|
this.talentIdList.add(talentData.getId());
|
||||||
|
|
||||||
// Packet
|
// Packet
|
||||||
this.getPlayer().sendPacket(new PacketAvatarUnlockTalentNotify(this, talentId));
|
if (player != null) {
|
||||||
this.getPlayer().sendPacket(new PacketUnlockAvatarTalentRsp(this, talentId));
|
player.sendPacket(new PacketAvatarUnlockTalentNotify(this, talentId));
|
||||||
|
player.sendPacket(new PacketUnlockAvatarTalentRsp(this, talentId));
|
||||||
|
}
|
||||||
|
|
||||||
// Proud skill bonus map (Extra skills)
|
// Proud skill bonus map (Extra skills)
|
||||||
this.calcConstellation(GameData.getOpenConfigEntries().get(talentData.getOpenConfig()), true);
|
this.calcConstellation(GameData.getOpenConfigEntries().get(talentData.getOpenConfig()), true);
|
||||||
|
Loading…
Reference in New Issue
Block a user