forked from OpenWF/SpaceNinjaServer
		
	fix: allow manageQuests' deleteKey op to be used with any ItemType (#1653)
Reviewed-on: OpenWF/SpaceNinjaServer#1653 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									38502f10bf
								
							
						
					
					
						commit
						729061951f
					
				@ -56,15 +56,12 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        case "deleteKey": {
 | 
					        case "deleteKey": {
 | 
				
			||||||
            if (allQuestKeys.includes(questItemType)) {
 | 
					            const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType);
 | 
				
			||||||
                const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType);
 | 
					            if (!questKey) {
 | 
				
			||||||
                if (!questKey) {
 | 
					                logger.error(`Quest key not found in inventory: ${questItemType}`);
 | 
				
			||||||
                    logger.error(`Quest key not found in inventory: ${questItemType}`);
 | 
					                break;
 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                inventory.QuestKeys.pull({ ItemType: questItemType });
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            inventory.QuestKeys.pull({ ItemType: questItemType });
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        case "completeKey": {
 | 
					        case "completeKey": {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user