Fix Weight Changes option

This commit is contained in:
George Gaulin 2022-06-26 12:09:25 -04:00
parent 40f35b7002
commit 9fc9100692

View File

@ -33,10 +33,14 @@ export class Items
} }
// Weight Change, only Multiple possible // Weight Change, only Multiple possible
if (typeof this.configHandler.getConfig().items.weightChanges !== "boolean" && typeof this.configHandler.getConfig().items.weightChanges === "number" && this.configHandler.getConfig().items.weightChanges <= 0) if (typeof this.configHandler.getConfig().items.weightChanges !== "boolean" && typeof this.configHandler.getConfig().items.weightChanges === "number" && this.configHandler.getConfig().items.weightChanges >= 0)
{
//Exclude nodes, inventory and pockets from the weight changer
if (base._type !== "Node" && base._parent !== BaseClasses.POCKETS && base._parent !== BaseClasses.INVENTORY)
{ {
this.editSimpleItemData(id, "Weight", (base._props.Weight * <number> this.configHandler.getConfig().items.weightChanges)); this.editSimpleItemData(id, "Weight", (base._props.Weight * <number> this.configHandler.getConfig().items.weightChanges));
} }
}
if (this.configHandler.getConfig().items.removeAllGearPenalties) if (this.configHandler.getConfig().items.removeAllGearPenalties)
{ {