Monsters with ID in party files may crash VCC
Submitted by Nebulorum on Sat, 2011-06-18 22:01
| Project: | Virtual Combat Cards |
| Version: | 1.5.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Nebulorum |
| Status: | closed |
Jump to:
Description
While running a game today, VCC crashed when loading a party file that had ID defined. I'm not sure what is happening, but will investigate. The way around was to create a new party and add the monsters without ID.

#1
I have done some investigating and the ID's don't seem to be the cause themselves. The failure happens because of the order of the elements in the file and the way errors are propagated to the User interface. The file in question has some monster with ID and some without. And the generated IDs are being over-written by the ID's the ones in the file. This produces two problems:
This behavior is broken in my opinion. When loading a files, IDs should not collide with generated IDs. As it works today if the first entry in the file has no ID it will get a generated ID (say 1). Then if the same file includes an entry with ID 1 specified it will overwrite the previous monster.
Another issue I found is that VCC will crash if several monsters in the party have the same ID. Maybe this should be blocked.
#2
I did a quick fix on the development branch, which solves problem 2 above, and partially problem 1.
The solution is to make sure that all party/encounter members with ID are returned first (regardless of the order they are saved). This means that specified IDs are added then VCC will generate IDs for the entries that do not specify one.
The complete solution involves a changes in the order of certain internal events, but since we are working on a major change on that logic, I'll postpone the secondary fix till version 1.6.0.
#3
Fixed partially on version 1.5.2. The new format should avoid problems with files that have part of the combatant with numeric IDs. Version 1.6.0 should provide a complete fix.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.