maurezen / AutoTrimps

Automation for the idle incremental game 'Trimps'
0 stars 0 forks source link

safeFireJob stuck in endless loop on Trapper^2 #64

Open maurezen opened 4 years ago

maurezen commented 4 years ago

Climbing BWs from z236 on Trapper^2 I found out that on about BW425 (and not earlier) it somehow got stuck in a loop at jobs#safeFireJob#68.

The issue here is that the loop operates on a difference between theoretical maximum of worker trimps and employed trimps, which, given reality of Trapper^2, is not going to be zero.

Please make this comparison use available worker trimps instead, and also make comparison with zero explicit.

maurezen commented 4 years ago

Using game.resources.trimps.owned instead of game.resources.trimps.realMax() alone won't cut it - because work space is function of realMax.

Please extract calculating free worker space as a standalone function and use it everywhere in jobs.