MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002681VCMIRandom Map Generatorpublic2017-05-26 15:402017-05-27 12:59
ReporterSXX 
Assigned ToWarmonger 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version0.99 
Target VersionFixed in Version1.next 
Summary0002681: RMG crash when used creatures with zero AIValue
DescriptionIn CRmgTemplateZone::addAllPossibleObjects there is "creatureToCount" lamba that using float for "creaturesAmount" and if AIValue is zero then it's going to become +infinity which of course cause crash on rounding.

This particularly occurs with WoG mod enabled. So this have to be fixed OR we should just forbid to add creatures with zero AIValue and trigger error on loading.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007047)
SXX (administrator)
2017-05-26 16:11

Warmonger since RMG is your code it's up to you to decide how to handle that, but probably we should require AIValue for all loaded creatures.
(0007049)
SXX (administrator)
2017-05-26 19:23

So just to be clear I suppose I stuck into that one due to some other resource loading priority problem on Linux and WoG actually have AIValue somewhere in assets and just not in JSON. Would still prefer if this one fixed.
(0007052)
Warmonger (administrator)
2017-05-27 09:11

Surely json should not allow 0 AI value.
(0007053)
Warmonger (administrator)
2017-05-27 12:47

Now interesting part: CRTRAITS.txt contains NOT_USED CREATURES, which indeed have 0 value. They should never show up, though.
(0007054)
Warmonger (administrator)
2017-05-27 12:59

Added some sanity checks in https://github.com/vcmi/vcmi/commit/346d2ac588b62e65a8aa8e140acf5adf9661a6b9 [^]

Can't really test, this should never occur in a game without bugged mods.

- Issue History
Date Modified Username Field Change
2017-05-26 15:40 SXX New Issue
2017-05-26 15:40 SXX Status new => assigned
2017-05-26 15:40 SXX Assigned To => Warmonger
2017-05-26 16:11 SXX Note Added: 0007047
2017-05-26 19:23 SXX Note Added: 0007049
2017-05-27 09:11 Warmonger Note Added: 0007052
2017-05-27 12:47 Warmonger Note Added: 0007053
2017-05-27 12:59 Warmonger Note Added: 0007054
2017-05-27 12:59 Warmonger Status assigned => resolved
2017-05-27 12:59 Warmonger Fixed in Version => 1.next
2017-05-27 12:59 Warmonger Resolution open => fixed

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2024 MantisBT Team
Hosting provided by DigitalOcean