# HG changeset patch # User IBBoard # Date 1256674180 0 # Node ID cedf8bba1d523535ca02e0a2d8456bcb929c91ff # Parent 36adabb1c3ea100cb2def423788354cc1f267094 Re #198: Add equipment slots * Alter handling of setting one limit and other limit matching by checking on Get instead of Set diff -r 36adabb1c3ea -r cedf8bba1d52 api/Objects/UnitEquipmentItem.cs --- a/api/Objects/UnitEquipmentItem.cs Mon Oct 26 20:55:04 2009 +0000 +++ b/api/Objects/UnitEquipmentItem.cs Tue Oct 27 20:09:40 2009 +0000 @@ -135,18 +135,27 @@ { get { - return (minLimit == null ? new UnlimitedLimit() : minLimit); + AbstractLimit limit = minLimit; + + if (limit == null) + { + if (maxLimit != null) + { + limit = maxLimit; + } + else + { + limit = new UnlimitedLimit(); + } + } + + return limit; } set { if (value != null) { - minLimit = value; - - if (maxLimit == null) - { - maxLimit = minLimit; - } + minLimit = value; } } } @@ -158,18 +167,27 @@ { get { - return (maxLimit == null ? new UnlimitedLimit() : maxLimit); + AbstractLimit limit = maxLimit; + + if (limit == null) + { + if (minLimit != null) + { + limit = minLimit; + } + else + { + limit = new UnlimitedLimit(); + } + } + + return limit; } set { if (value != null) { - maxLimit = value; - - if (minLimit == null) - { - minLimit = maxLimit; - } + maxLimit = value; } } }