MantisBT - VCMI
View Issue Details
0002461VCMIAI - Adventure Mappublic2016-08-23 03:472016-09-08 01:31
SXX 
SXX 
normalcrashalways
resolvedfixed 
0.98g 
0.98g 
0002461: VCAI: Infinite loop when attempt to compare and exchange artifacts
Back when I fixed 0002455 there was typo (I suppose it's wasn't intentional since there was no comments) in Warmonger's code that made AI stop artifact exchange after first item was swapped.

https://github.com/vcmi/vcmi/commit/39fe9472b60d05401aa2889d4698bac2c74a9c6b#diff-17182f23fecdfcf334d0f03f9bd612c7L1089 [^]

End up that without that break AI tend to go into infinite loop since "compareArtifacts" func is very basic from perfect. E.g first time AI exchange arts since stats better and second time it's make change back since price is higher.
No tags attached.
related to 0002455closed SXX VCAI: Freeze on attempt to move artifact locks 
Issue History
2016-08-23 03:47SXXNew Issue
2016-08-23 03:47SXXStatusnew => assigned
2016-08-23 03:47SXXAssigned To => SXX
2016-08-23 03:48SXXDescription Updatedbug_revision_view_page.php?rev_id=3214#r3214
2016-08-23 03:49SXXNote Added: 0006579
2016-08-23 03:49SXXProduct Version0.99 => 0.98g
2016-08-23 03:49SXXRelationship addedrelated to 0002455
2016-08-23 03:52SXXSummaryVCAI: Loop when attempt to exchange artifacts => VCAI: Infinite loop when attempt to compare and exchange artifacts
2016-09-08 01:31SXXNote Added: 0006631
2016-09-08 01:31SXXStatusassigned => resolved
2016-09-08 01:31SXXFixed in Version => 0.98g
2016-09-08 01:31SXXResolutionopen => fixed

Notes
(0006579)
SXX   
2016-08-23 03:49   
I worked on a bit better compareArtifacts code, but since I switch to fix leaks and desyncs want to keep in on bugtracker.
(0006631)
SXX   
2016-09-08 01:31   
Fixed easy way for now:

https://github.com/vcmi/vcmi/commit/78a560767bce07f25b07b4b55e02a232269b393f [^]