Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#187 closed defect (released)

Error when adding equipment with minNum > unit size

Reported by: Henri Owned by: ibboard
Priority: minor Milestone: WarFoundry 0.1
Component: WarFoundry-GUI-WinForms Version:
Keywords: unitequipment limit Cc:
Blocked By: Blocking:

Description

Apparently if I make this equipment entry, WF doesn't quite like it.

<unitEquipmentItem id="Skorcha" minNum="2" maxNum="4"/>

I assume that it still needs to have the default set to "2" as well?

Attachments (3)

crash7.txt (5.2 KB) - added by Henri 10 years ago.
debug text
Orks.race (2.3 KB) - added by Henri 10 years ago.
Race file to test
wh40k - Copy.system (507 bytes) - added by Henri 10 years ago.
system file

Download all attachments as: .zip

Change History (17)

Changed 10 years ago by Henri

Attachment: crash7.txt added

debug text

comment:1 Changed 10 years ago by ibboard

Ah, looks like we have an assumption that doesn't always hold. The error is because the percentage box is trying to show "200%", but is limited to values between 0 and 100%.

I'll need to look at how to handle it in more detail so that situations like this work without letting us get in to a mess in the normal "one per trooper" situation. Maybe we need to distinguish "max per unit" and "max per model".

comment:2 Changed 10 years ago by ibboard

Status: newconfirmed

Move tickets to new "confirmed" status to show that they've been checked

comment:3 Changed 10 years ago by ibboard

Summary: Error when adding equipment with minNumError when adding equipment with minNum > unit size

comment:4 Changed 10 years ago by ibboard

Resolution: fixed
Status: confirmedclosed

(In r311) Fixes #187: Error when adding equipment with minNum > unit size

  • Handle percentages greater than 100
    • Remove value change listeners before setting min/max and re-add in new wrapper method
    • Hide value setting method and handle internally

comment:5 Changed 10 years ago by Henri

Sorry to reopen, but there seems to something odd in the maths here.
Creating a "every ten models" (10% max) constriction seems to be messing with the percentages. At first it doubled the percentage and failed constantly. I fixed that with a roundDirection = "down".

Now I find that when working with it increasing and reducing the number of items it will "freeze" (it zeroes the items despite that it should allow 3) when having 30 models.

Changed 10 years ago by Henri

Attachment: Orks.race added

Race file to test

Changed 10 years ago by Henri

Attachment: wh40k - Copy.system added

system file

comment:6 Changed 10 years ago by ibboard

Resolution: fixed
Status: closedreopened

Thanks for the data files - always useful when tracking down a bug like this :) I did only commit the fix 37 hours ago at the moment, so you won't have it yet (it'll be in beta 4 :) ) but I'll use those data files to make sure that I've fixed the problems.

Maybe we need a "released" status that comes after "fixed" or something :)

comment:7 Changed 10 years ago by ibboard

Keywords: unitequipment limit added
Owner: set to ibboard
Status: reopenedaccepted

comment:8 Changed 10 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

(In r313) Fixes #187: Error when adding equipment with minNum > unit size

  • Separate out methods to ensure that the percentages and numbers are kept correct and that they're not messed up when editing percentage equipment items

comment:9 Changed 10 years ago by ibboard

Set fix not released (field is boolean but doesn't take a default "false" value)

comment:10 Changed 10 years ago by ibboard

released: 1

Mark fix as released even though it isn't to set a value

comment:11 Changed 10 years ago by ibboard

released: 1

Mark fix as not released for unreleased changes

comment:12 Changed 10 years ago by ibboard

released: no

Mark unreleased fixes as not released

comment:13 Changed 10 years ago by ibboard

released: noyes

Released on 31st October as part of v0.1b4

comment:14 Changed 10 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under a previous version

Note: See TracTickets for help on using tickets.