mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
perf: 使用临期药品时, 如果存在时效识别失败的药品则取消本次吃药
This commit is contained in:
@@ -149,6 +149,13 @@ bool asst::MedicineCounterTaskPlugin::_run()
|
||||
if (m_expire_days > 0) {
|
||||
bool has_non_expiring = false;
|
||||
for (const auto& [use, _, expire_days, __] : using_medicine->medicines) {
|
||||
if (use > 0 && expire_days == -1) {
|
||||
LogError << __FUNCTION__
|
||||
<< "There are non-expiring medicines, and total count exceed max, need to reduce expire "
|
||||
"medicines first";
|
||||
has_non_expiring = true;
|
||||
break;
|
||||
}
|
||||
if (use > 0 && expire_days != -1 && expire_days > m_expire_days) {
|
||||
has_non_expiring = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user