From 7096025175b6d100923dcd66c1face07d2e28555 Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期四, 24 七月 2025 15:20:21 +0800
Subject: [PATCH] 1. 完善获取配方列表的功能 2. 添加获取配方超时警告
---
SourceCode/Bond/Servo/CRecipeList.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/SourceCode/Bond/Servo/CRecipeList.cpp b/SourceCode/Bond/Servo/CRecipeList.cpp
index 62306a3..01eec82 100644
--- a/SourceCode/Bond/Servo/CRecipeList.cpp
+++ b/SourceCode/Bond/Servo/CRecipeList.cpp
@@ -26,7 +26,7 @@
return m_nUnitNo;
}
- int CRecipeList::addRecipePacket(int totalGroup, int currentGroup, const char* pszData, size_t size)
+ int CRecipeList::addRecipePacket(int totalCount, int totalGroup, int currentGroup, const char* pszData, size_t size)
{
if (m_nToatlGroupCount == 0) m_nToatlGroupCount = totalGroup;
if (m_nToatlGroupCount != totalGroup) {
@@ -47,7 +47,9 @@
for (int i = 0; i < size; i += 4) {
int index = CToolUnits::toInt16(&pszData[i]);
short id = CToolUnits::toInt16(&pszData[i + 2]);
- addRecipe(index, id);
+ if (index != 0 && id != 0) {
+ addRecipe(index, id);
+ }
}
if (m_nCurrentGroupCount == m_nToatlGroupCount) {
@@ -67,7 +69,7 @@
}
m_ids[index] = id;
- return 0;
+ return (int)m_ids.size();
}
std::map<int, short>& CRecipeList::getIds()
--
Gitblit v1.9.3