SonicTHI / SaveOurShip2Experimental

Experimental branch of Save Our Ship 2
Other
230 stars 86 forks source link

Endless gift spam from archospore if mood >149 due to logical issue #121

Closed bitbucketcynic closed 7 months ago

bitbucketcynic commented 7 months ago

If you use a mod to increase the maximum value of colonist moods past the normal 100%, this causes some likely unanticipated behavior with archospore gifts. The game isn't throwing errors so there are no logs of it; the archospore just constantly gives gifts nonstop (or at least as fast as the base game can spit out new quests) when its mood is 150% or higher.

Poking around in the code, the culprit seems to be in \Building\Building_ArchotechSpore.cs on line 101:

        if (tick-lastGiftTick > 90000 * (5- NumConnectedPillars) * (3-mood))

The way you calculate mood, if the archospore's in-game mood is 150% or higher this evaluates to a negative tick count since the last gift, resulting in endless gifts. This seems an easy enough fix with a slight change in logic.

SonicTHI commented 7 months ago

Really dumb mod for pushing stats like that beyond the intended level but w/e, clamped it.