mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
fix: 临期理智药天数缺省值
This commit is contained in:
@@ -66,12 +66,12 @@ bool asst::FightTask::set_params(const json::value& params)
|
||||
|
||||
const std::string stage = params.get("stage", "");
|
||||
const int medicine = params.get("medicine", 0);
|
||||
int medicine_expire_days = 2;
|
||||
int medicine_expire_days = 0;
|
||||
if (auto expiring_day_opt = params.find<int>("medicine_expire_days"); !expiring_day_opt) {
|
||||
if (auto opt = params.find<int>("expiring_medicine"); opt) {
|
||||
medicine_expire_days = opt.value() == 0 ? 0 : 2;
|
||||
LogWarn << "================ DEPRECATED ================";
|
||||
LogWarn << __FUNCTION__ << " 'expiring_medicine' is deprecated, please use 'medicine_expire_days' instead.";
|
||||
LogWarn << __FUNCTION__ << " 'expiring_medicine' is deprecated since v6.8.0, please use 'medicine_expire_days' instead.";
|
||||
LogWarn << "================ DEPRECATED ================";
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ bool asst::FightTask::set_params(const json::value& params)
|
||||
medicine_expire_days = expiring_day_opt.value();
|
||||
}
|
||||
if (medicine_expire_days < 0) {
|
||||
LogError << __FUNCTION__ << "Invalid medicine_expire_days";
|
||||
LogError << __FUNCTION__ << "Invalid medicine_expire_days," << medicine_expire_days;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user