Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Slavery Compatibility #137

Closed
Aviuz opened this issue Jan 26, 2019 · 4 comments
Closed

Simple Slavery Compatibility #137

Aviuz opened this issue Jan 26, 2019 · 4 comments
Assignees

Comments

@Aviuz
Copy link
Owner

Aviuz commented Jan 26, 2019

Install both Prison Labor 0.10.0 dev and Simple Slavery latest version.
Enslaving prisoner (Simple Slavery mechanics) will result in the pawn recruited, but without the usual notification of successful enslavement and the pawn is now a colonist instead of a slave.
Both mod works fine using Prison Labor 0.9.11 and older versions.
So, I guess it;s the 0.10.0 dev version.

@Aviuz Aviuz changed the title Recruiting prisoners Simple Slavery Compatibility Jan 26, 2019
@ghost
Copy link

ghost commented Jul 1, 2020

I'm the current maintainer of the 1.1 version. I just fixed this bug on my end, but it seems like it's caused by Prison Labor setting a pawn's workSettings field to null.

Being new to RimWorld modding, I don't know if I'm handling this correctly, but here's how I think it could be fixed on Prison Labor's end:

// Instead of __instance.workSettings = null;
__instance.workSettings = new Pawn_WorkSettings(__instance);
__instance.workSettings.EnableAndInitialize();

@Hazzer
Copy link
Collaborator

Hazzer commented Jul 1, 2020

Looking on decompiled method SetFaction method just : __instance.workSettings = new Pawn_WorkSettings(__instance); should be enought

@ghost
Copy link

ghost commented Jul 1, 2020

Pawn.SetFaction calls this.workSettings.EnableAndInitialize() if joining the player faction and workSettings isn't null.

If you don't you get an error (but it still seems to work).

Edit: Oops, just remembered the patch is a prefix. Yeah, your code would be enough to work.

@Hazzer
Copy link
Collaborator

Hazzer commented Jul 1, 2020

Done. it will be in next patch :)

@Hazzer Hazzer closed this as completed Jul 1, 2020
@Hazzer Hazzer self-assigned this Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants