From 3404823d074a08b8c0824b505db16168f7e66201 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 09 六月 2025 09:49:10 +0800
Subject: [PATCH] Merge branch 'clh'

---
 SourceCode/Bond/Servo/CEquipment.cpp |   40 +++++++++++++++++++++++++++++++---------
 1 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/SourceCode/Bond/Servo/CEquipment.cpp b/SourceCode/Bond/Servo/CEquipment.cpp
index 0aa06b1..35c81b8 100644
--- a/SourceCode/Bond/Servo/CEquipment.cpp
+++ b/SourceCode/Bond/Servo/CEquipment.cpp
@@ -47,7 +47,6 @@
 		for (int i = 0; i < SLOT_MAX; i++) {
 			CContext* pContext = m_slot[i].getContext();
 			if (pContext != nullptr) {
-				pContext->release();
 				m_slot[i].setContext(nullptr);
 			}
 		}
@@ -1149,10 +1148,11 @@
 			if (m_slot[i].isLock()) continue;
 			CGlass* pGlass = (CGlass*)m_slot[i].getContext();
 			if (pGlass == nullptr) continue;
-			if(!m_bLinkSignal[0][SIGNAL_UPSTREAM_INLINE]
-				|| m_bLinkSignal[0][SIGNAL_UPSTREAM_TROUBLE]
-				|| !m_bLinkSignal[0][SIGNAL_INTERLOCK]
-				|| !m_bLinkSignal[0][SIGNAL_SEND_ABLE] ) continue;
+			int lsPath = m_slot[i].getLinkSignalPath();
+			if(!m_bLinkSignal[lsPath][SIGNAL_UPSTREAM_INLINE]
+				|| m_bLinkSignal[lsPath][SIGNAL_UPSTREAM_TROUBLE]
+				|| !m_bLinkSignal[lsPath][SIGNAL_INTERLOCK]
+				|| !m_bLinkSignal[lsPath][SIGNAL_SEND_ABLE] ) continue;
 
 			MaterialsType glassType = pGlass->getType();
 			if (glassType == MaterialsType::G1 && putSlotType == MaterialsType::G2) continue;
@@ -1173,10 +1173,11 @@
 					if (m_slot[i].isLock()) continue;
 					CGlass* pGlass = (CGlass*)m_slot[i].getContext();
 					if (pGlass == nullptr) continue;
-					if (!m_bLinkSignal[0][SIGNAL_UPSTREAM_INLINE]
-						|| m_bLinkSignal[0][SIGNAL_UPSTREAM_TROUBLE]
-						|| !m_bLinkSignal[0][SIGNAL_INTERLOCK]
-						|| !m_bLinkSignal[0][SIGNAL_SEND_ABLE]) continue;
+					int lsPath = m_slot[i].getLinkSignalPath();
+					if (!m_bLinkSignal[lsPath][SIGNAL_UPSTREAM_INLINE]
+						|| m_bLinkSignal[lsPath][SIGNAL_UPSTREAM_TROUBLE]
+						|| !m_bLinkSignal[lsPath][SIGNAL_INTERLOCK]
+						|| !m_bLinkSignal[lsPath][SIGNAL_SEND_ABLE]) continue;
 
 					MaterialsType glassType = pGlass->getType();
 					if (glassType == MaterialsType::G1 && putSlotType == MaterialsType::G2) continue;
@@ -1188,6 +1189,12 @@
 		}
 
 		return nullptr;
+	}
+
+	CSlot* CEquipment::getSlot(int index)
+	{
+		if (index >= SLOT_MAX) return nullptr;
+		return &m_slot[index];
 	}
 
 	CGlass* CEquipment::getGlassFromSlot(int slotNo)
@@ -1229,6 +1236,21 @@
 		return TRUE;
 	}
 
+	int CEquipment::removeGlass(int slotNo)
+	{
+		CSlot* pSlot = nullptr;
+		for (int i = 0; i < SLOT_MAX; i++) {
+			if (!m_slot[i].isEnable()) continue;
+			if (m_slot[i].getNo() != slotNo) continue;
+			pSlot = &m_slot[i];
+			break;
+		}
+
+		if (pSlot == nullptr) return -1;
+		pSlot->setContext(nullptr);
+		return 0;
+	}
+
 	short CEquipment::decodeRecipeListReport(const char* pszData, size_t size)
 	{
 		return m_recipesManager.decodeRecipeListReport(pszData, size);

--
Gitblit v1.9.3