mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
fix: 资源操作兼容Partial类型
将addResources和deductResources的参数类型由Resources调整为Partial<Resources>,避免部分字段缺失时报错。同步修正任务奖励发放逻辑,提升资源操作的健壮性。
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
||||
type QuestNotification,
|
||||
type CampaignQuestConfig,
|
||||
type NPC,
|
||||
type Resources,
|
||||
RelationStatus,
|
||||
type BuildingType,
|
||||
type TechnologyType,
|
||||
@@ -357,7 +356,7 @@ export const claimQuestRewards = (
|
||||
const currentPlanet = player.planets[0] // 默认发放到第一个星球
|
||||
|
||||
if (rewards.resources && currentPlanet) {
|
||||
resourceLogic.addResources(currentPlanet.resources, rewards.resources as Resources)
|
||||
resourceLogic.addResources(currentPlanet.resources, rewards.resources)
|
||||
}
|
||||
|
||||
if (rewards.darkMatter && currentPlanet) {
|
||||
|
||||
Reference in New Issue
Block a user