fix: don't use path-based matching to add QuestKeys (#967)
Reviewed-on: OpenWF/SpaceNinjaServer#967 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
		
							parent
							
								
									1413a6bcc2
								
							
						
					
					
						commit
						00a75a33fa
					
				@ -38,6 +38,7 @@ import {
 | 
			
		||||
    ExportCustoms,
 | 
			
		||||
    ExportFlavour,
 | 
			
		||||
    ExportGear,
 | 
			
		||||
    ExportKeys,
 | 
			
		||||
    ExportRecipes,
 | 
			
		||||
    ExportResources,
 | 
			
		||||
    ExportSentinels,
 | 
			
		||||
@ -365,6 +366,19 @@ export const addItem = async (
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
    if (typeName in ExportKeys) {
 | 
			
		||||
        // Note: "/Lotus/Types/Keys/" contains some EmailItems and ShipFeatureItems
 | 
			
		||||
        inventory.QuestKeys.push({ ItemType: typeName });
 | 
			
		||||
        return {
 | 
			
		||||
            InventoryChanges: {
 | 
			
		||||
                QuestKeys: [
 | 
			
		||||
                    {
 | 
			
		||||
                        ItemType: typeName
 | 
			
		||||
                    }
 | 
			
		||||
                ]
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Path-based duck typing
 | 
			
		||||
    switch (typeName.substr(1).split("/")[1]) {
 | 
			
		||||
@ -481,18 +495,6 @@ export const addItem = async (
 | 
			
		||||
                    }
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                case "Keys": {
 | 
			
		||||
                    inventory.QuestKeys.push({ ItemType: typeName });
 | 
			
		||||
                    return {
 | 
			
		||||
                        InventoryChanges: {
 | 
			
		||||
                            QuestKeys: [
 | 
			
		||||
                                {
 | 
			
		||||
                                    ItemType: typeName
 | 
			
		||||
                                }
 | 
			
		||||
                            ]
 | 
			
		||||
                        }
 | 
			
		||||
                    };
 | 
			
		||||
                }
 | 
			
		||||
                case "NeutralCreatures": {
 | 
			
		||||
                    const horseIndex = inventory.Horses.push({ ItemType: typeName });
 | 
			
		||||
                    return {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user