Bugfix for 1.3 version [Recipe_ModifyMechanoid_WorkModule.PostSuccessfulApply NULLReferecnceException!] #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This bug appears only if you remove all work-modules from you mechanoid and tried to install one of them again (Module only appears as hediff. Mechanoid will not do any work if bug happens (even in you install all modules again and only posible solution is killing current mechanoid and replacing him by new one)). See code in Recipe_ModifyMechanoid_UninstallModule on string number 45 to see the reason. I also make some things protected (see commits) because compiler says that they must be protected. This pull also contain changed WhatTheHack.dll file, so it's "ready to play" and if anyone wants they just can replace original WTH mod files with my files, to make it work correctly.
If you become the victim of this bug and your mechanoid refuse to make any types of work, just install any new work module on it and everything will be fine. (This will work only if you replace WTH with my code)
P.S. Sorry for some useless commits... I realized that If you remove the last module mechanoid also lose it's hunting ability so, I remade my fix and change some stuff in reason. Now every thing should work fine...