소스 검색

Added some more checks to Laphine UIs (#6654)

Lemongrass3110 3 년 전
부모
커밋
d79db934cb
2개의 변경된 파일19개의 추가작업 그리고 3개의 파일을 삭제
  1. 18 2
      src/map/clif.cpp
  2. 1 1
      src/map/itemdb.cpp

+ 18 - 2
src/map/clif.cpp

@@ -23190,6 +23190,16 @@ void clif_parse_laphine_synthesis( int fd, struct map_session_data* sd ){
 			clif_laphine_synthesis_result( sd, LAPHINE_SYNTHESIS_ITEM );
 			return;
 		}
+
+		if( item->equip != 0 ){
+			clif_laphine_synthesis_result( sd, LAPHINE_SYNTHESIS_ITEM );
+			return;
+		}
+
+		if( item->equipSwitch != 0 ){
+			clif_laphine_synthesis_result( sd, LAPHINE_SYNTHESIS_ITEM );
+			return;
+		}
 	}
 
 	int16 index = pc_search_inventory( sd, sd->state.laphine_synthesis );
@@ -23200,7 +23210,7 @@ void clif_parse_laphine_synthesis( int fd, struct map_session_data* sd ){
 	}
 
 	if( ( sd->inventory_data[index]->flag.delay_consume & DELAYCONSUME_NOCONSUME ) == 0 ){
-		if( pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_CONSUME ) != 0 ){
+		if( pc_delitem( sd, index, 1, 0, 0, LOG_TYPE_LAPHINE ) != 0 ){
 			return;
 		}
 	}
@@ -23323,6 +23333,12 @@ void clif_parse_laphine_upgrade( int fd, struct map_session_data* sd ){
 		return;
 	}
 
+	// If target item is in equipswitch
+	if( item->equipSwitch != 0 ){
+		clif_laphine_upgrade_result( sd, true );
+		return;
+	}
+
 	// Check minimum refine requirement
 	if( item->refine < upgrade->minimumRefine ){
 		clif_laphine_upgrade_result( sd, true );
@@ -23369,7 +23385,7 @@ void clif_parse_laphine_upgrade( int fd, struct map_session_data* sd ){
 	}
 
 	if( ( sd->inventory_data[index2]->flag.delay_consume & DELAYCONSUME_NOCONSUME ) == 0 ){
-		if( pc_delitem( sd, index2, 1, 0, 0, LOG_TYPE_CONSUME ) != 0 ){
+		if( pc_delitem( sd, index2, 1, 0, 0, LOG_TYPE_LAPHINE ) != 0 ){
 			return;
 		}
 	}

+ 1 - 1
src/map/itemdb.cpp

@@ -1572,7 +1572,7 @@ uint64 LaphineUpgradeDatabase::parseBodyNode( const YAML::Node& node ){
 			return 0;
 		}
 
-		entry->cardsAllowed = true;
+		entry->cardsAllowed = allowed;
 	}else{
 		if( !exists ){
 			entry->cardsAllowed = false;