Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rjw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gargule
rjw
Commits
b33a315f
Commit
b33a315f
authored
2 years ago
by
Ed86
Browse files
Options
Downloads
Patches
Plain Diff
added designators unset when guest/prisoner/slave leave map
parent
e63095b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
1.3/Source/Harmony/DesignatorsUnset.cs
+62
-0
62 additions, 0 deletions
1.3/Source/Harmony/DesignatorsUnset.cs
1.3/Source/RimJobWorld.Main.csproj
+1
-0
1 addition, 0 deletions
1.3/Source/RimJobWorld.Main.csproj
with
63 additions
and
0 deletions
1.3/Source/Harmony/DesignatorsUnset.cs
0 → 100644
+
62
−
0
View file @
b33a315f
using
HarmonyLib
;
using
RimWorld
;
using
System
;
using
Verse
;
namespace
rjw
{
///<summary>
///unset designators on GuestRelease
///until pawn leaves map, pawn is still guest/slave/prisoner, so they can actually be changed back
///</summary>
[
HarmonyPatch
(
typeof
(
GenGuest
),
"GuestRelease"
)]
[
StaticConstructorOnStartup
]
static
class
PATCH_GenGuest_GuestRelease
{
[
HarmonyPrefix
]
private
static
void
GuestRelease_Update_Designators
(
Pawn
p
)
{
if
(
p
!=
null
)
{
//ModLog.Message("GenGuest GuestRelease");
//ModLog.Message("pawn: " + xxx.get_pawnname(p));
p
.
UnDesignateComfort
();
p
.
UnDesignateService
();
p
.
UnDesignateBreeding
();
p
.
UnDesignateBreedingAnimal
();
p
.
UnDesignateMilking
();
p
.
UnDesignateHero
();
//ModLog.Message(p.IsDesignatedComfort().ToString());
}
}
}
///<summary>
///unset designators on Pawn_ExitMap
///now pawn actually leaves map and get their factions reset
///</summary>
[
HarmonyPatch
(
typeof
(
Pawn
),
"ExitMap"
)]
[
StaticConstructorOnStartup
]
static
class
PATCH_Pawn_ExitMap
{
[
HarmonyPrefix
]
private
static
void
Pawn_ExitMap_Update_Designators
(
Pawn
__instance
,
bool
allowedToJoinOrCreateCaravan
,
Rot4
exitDir
)
{
Pawn
p
=
__instance
;
if
(
p
!=
null
)
if
(!
p
.
IsColonist
)
{
//ModLog.Message("Pawn ExitMap");
//ModLog.Message("pawn: " + xxx.get_pawnname(p));
p
.
UnDesignateComfort
();
p
.
UnDesignateService
();
p
.
UnDesignateBreeding
();
p
.
UnDesignateBreedingAnimal
();
p
.
UnDesignateMilking
();
p
.
UnDesignateHero
();
//ModLog.Message(p.IsDesignatedComfort().ToString());
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
1.3/Source/RimJobWorld.Main.csproj
+
1
−
0
View file @
b33a315f
...
...
@@ -97,6 +97,7 @@
<Compile Include="Designators\Milking.cs" />
<Compile Include="Designators\Utility.cs" />
<Compile Include="Designators\Service.cs" />
<Compile Include="Harmony\DesignatorsUnset.cs" />
<Compile Include="Harmony\patch_meditate.cs" />
<Compile Include="Harmony\Patch_PawnGenerator.cs" />
<Compile Include="Harmony\Building_Bed_Patch.cs" />
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment