mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 21:34:35 +01:00
Fix relics/lightcones not applying after switching paths
This commit is contained in:
@@ -243,20 +243,18 @@ public class GameAvatar implements GameEntity, IAvatar {
|
||||
.setIsMarked(this.isMarked())
|
||||
.setFirstMetTimestamp(this.getTimestamp());
|
||||
|
||||
if (!this.hasMultiPath()) {
|
||||
for (var equip : this.getEquips().values()) {
|
||||
if (equip.getItemMainType() == ItemMainType.Relic) {
|
||||
proto.addEquipRelicList(EquipRelic.newInstance().setSlot(equip.getEquipSlot()).setRelicUniqueId(equip.getInternalUid()));
|
||||
} else if (equip.getItemMainType() == ItemMainType.Equipment) {
|
||||
proto.setEquipmentUniqueId(equip.getInternalUid());
|
||||
}
|
||||
}
|
||||
|
||||
for (var skill : getSkills().entrySet()) {
|
||||
proto.addSkilltreeList(AvatarSkillTree.newInstance().setPointId(skill.getKey()).setLevel(skill.getValue()));
|
||||
for (var equip : this.getEquips().values()) {
|
||||
if (equip.getItemMainType() == ItemMainType.Relic) {
|
||||
proto.addEquipRelicList(EquipRelic.newInstance().setSlot(equip.getEquipSlot()).setRelicUniqueId(equip.getInternalUid()));
|
||||
} else if (equip.getItemMainType() == ItemMainType.Equipment) {
|
||||
proto.setEquipmentUniqueId(equip.getInternalUid());
|
||||
}
|
||||
}
|
||||
|
||||
for (var skill : getSkills().entrySet()) {
|
||||
proto.addSkilltreeList(AvatarSkillTree.newInstance().setPointId(skill.getKey()).setLevel(skill.getValue()));
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.getPromotion(); i++) {
|
||||
if (this.hasTakenReward(i)) {
|
||||
proto.addTakenRewards(i);
|
||||
|
||||
@@ -483,12 +483,8 @@ public class Player implements Tickable {
|
||||
this.getCurAvatarPaths().put(excel.getBaseAvatarID(), pathId);
|
||||
|
||||
// Sync with client
|
||||
this.sendPacket(new PacketPlayerSyncScNotify(path));
|
||||
for (var item : avatar.getEquips().values()) {
|
||||
this.sendPacket(new PacketPlayerSyncScNotify(item));
|
||||
}
|
||||
|
||||
this.sendPacket(new PacketAvatarPathChangedNotify(avatar, path));
|
||||
this.sendPacket(new PacketPlayerSyncScNotify(avatar));
|
||||
|
||||
// Success
|
||||
return pathId;
|
||||
|
||||
@@ -16,7 +16,6 @@ public class PacketGetMultiPathAvatarInfoScRsp extends BasePacket {
|
||||
|
||||
for (AvatarMultiPath path : player.getAvatars().getMultiPaths().values()) {
|
||||
data.addMultiPathAvatarInfoList(path.toProto());
|
||||
data.addBasicTypeIdList(path.getExcelId());
|
||||
}
|
||||
|
||||
for (var entry : player.getCurAvatarPaths().entrySet()) {
|
||||
@@ -25,6 +24,7 @@ public class PacketGetMultiPathAvatarInfoScRsp extends BasePacket {
|
||||
.setValueValue(entry.getValue());
|
||||
|
||||
data.addCurAvatarPath(info);
|
||||
data.addBasicTypeIdList(entry.getValue());
|
||||
}
|
||||
|
||||
this.setData(data);
|
||||
|
||||
Reference in New Issue
Block a user