🐞 fix(宝物抽卡): 修复心愿单走错的问题

This commit is contained in:
luying
2023-09-21 20:18:54 +08:00
parent 784b00356a
commit e517a34d96

View File

@@ -470,7 +470,10 @@ export class GachaPull {
let { dic: { id: randHopePosition } } = getRandEelmWithWeight(gameData.gachaHope); let { dic: { id: randHopePosition } } = getRandEelmWithWeight(gameData.gachaHope);
if(randHopePosition > 0) { // 按玩家设置的心愿单塞 if(randHopePosition > 0) { // 按玩家设置的心愿单塞
let hopeHero = this.player.getHopeHero(randHopePosition) let hopeHero = this.player.getHopeHero(randHopePosition)
if(hopeHero > 0) gachaResult.setHero(hopeHero, 1); if(hopeHero > 0) {
if (this.gachaType == GACHA_TYPE.NORMAL) gachaResult.setHero(hopeHero, 1);
if (this.gachaType == GACHA_TYPE.ARTIFACT) gachaResult.setItem(hopeHero, 1);
}
} }
this.player.setUserHope(gachaResult.hid); // 设置心愿单中了没有 this.player.setUserHope(gachaResult.hid); // 设置心愿单中了没有
} }