forked from OpenWF/SpaceNinjaServer
		
	fix: don't give mastery xp for SpecialItems except for venari (#2484)
Closes #2482 Reviewed-on: OpenWF/SpaceNinjaServer#2484 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
							
								
									8feb3a5b3c
								
							
						
					
					
						commit
						ba3df4bdbc
					
				@ -1662,28 +1662,34 @@ export const applyClientEquipmentUpdates = (
 | 
				
			|||||||
            item.XP ??= 0;
 | 
					            item.XP ??= 0;
 | 
				
			||||||
            item.XP += XP;
 | 
					            item.XP += XP;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            let xpItemType = item.ItemType;
 | 
					            if (
 | 
				
			||||||
            if (item.ModularParts) {
 | 
					                categoryName != "SpecialItems" ||
 | 
				
			||||||
                for (const part of item.ModularParts) {
 | 
					                item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraKavatPowerSuit" ||
 | 
				
			||||||
                    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
 | 
					                item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraPrimeKavatPowerSuit"
 | 
				
			||||||
                    const partType = ExportWeapons[part]?.partType;
 | 
					            ) {
 | 
				
			||||||
                    if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) {
 | 
					                let xpItemType = item.ItemType;
 | 
				
			||||||
                        xpItemType = part;
 | 
					                if (item.ModularParts) {
 | 
				
			||||||
                        break;
 | 
					                    for (const part of item.ModularParts) {
 | 
				
			||||||
 | 
					                        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
 | 
				
			||||||
 | 
					                        const partType = ExportWeapons[part]?.partType;
 | 
				
			||||||
 | 
					                        if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) {
 | 
				
			||||||
 | 
					                            xpItemType = part;
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					                    logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType);
 | 
					                const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType);
 | 
				
			||||||
            if (xpinfoIndex !== -1) {
 | 
					                if (xpinfoIndex !== -1) {
 | 
				
			||||||
                const xpinfo = inventory.XPInfo[xpinfoIndex];
 | 
					                    const xpinfo = inventory.XPInfo[xpinfoIndex];
 | 
				
			||||||
                xpinfo.XP += XP;
 | 
					                    xpinfo.XP += XP;
 | 
				
			||||||
            } else {
 | 
					                } else {
 | 
				
			||||||
                inventory.XPInfo.push({
 | 
					                    inventory.XPInfo.push({
 | 
				
			||||||
                    ItemType: xpItemType,
 | 
					                        ItemType: xpItemType,
 | 
				
			||||||
                    XP: XP
 | 
					                        XP: XP
 | 
				
			||||||
                });
 | 
					                    });
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user