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
Hazzardous
rjw
Commits
e3b926d3
Commit
e3b926d3
authored
2 years ago
by
a flock of birds
Browse files
Options
Downloads
Patches
Plain Diff
Fixed error when babies become children with ideology installed but not biotech
parent
16dbe779
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
1.4/Source/Harmony/BiotechPatches.cs
+7
-6
7 additions, 6 deletions
1.4/Source/Harmony/BiotechPatches.cs
with
7 additions
and
6 deletions
1.4/Source/Harmony/BiotechPatches.cs
+
7
−
6
View file @
e3b926d3
...
...
@@ -22,10 +22,11 @@ namespace rjw
// Fixes an error caused by trying to spawn a biotech-only effector when a child starts a new lifestage
[
HarmonyTranspiler
]
static
IEnumerable
<
CodeInstruction
>
FixLifeStageStartError
(
IEnumerable
<
CodeInstruction
>
instructions
)
static
IEnumerable
<
CodeInstruction
>
FixLifeStageStartError
(
IEnumerable
<
CodeInstruction
>
instructions
,
MethodBase
original
)
{
PropertyInfo
thingSpawned
=
AccessTools
.
DeclaredProperty
(
typeof
(
Thing
),
nameof
(
Thing
.
Spawned
));
bool
finished
=
false
;
MethodInfo
shouldSendNotificationsAbout
=
AccessTools
.
Method
(
typeof
(
PawnUtility
),
nameof
(
PawnUtility
.
ShouldSendNotificationAbout
));
bool
foundAny
=
false
;
foreach
(
var
instruction
in
instructions
)
{
...
...
@@ -33,17 +34,17 @@ namespace rjw
// if (pawn.Spawned) SpawnBiotechOnlyEffector()
// => if (pawn.Spawned && ModsConfig.IsBiotechActive) SpawnBiotechOnlyEffector()
if
(
!
finished
&&
instruction
.
Calls
(
thingSpawned
.
GetMethod
))
if
(
instruction
.
Calls
(
thingSpawned
.
GetMethod
)
||
instruction
.
Calls
(
shouldSendNotificationsAbout
)
)
{
yield
return
CodeInstruction
.
Call
(
typeof
(
ModsConfig
),
"get_BiotechActive"
);
yield
return
new
CodeInstruction
(
OpCodes
.
And
);
f
inished
=
true
;
f
oundAny
=
true
;
}
}
if
(!
f
inished
)
if
(!
f
oundAny
)
{
ModLog
.
Error
(
"Failed to patch
LifeStageWorker_HumanlikeChild.Notify_LifeStageStarted"
);
ModLog
.
Error
(
"Failed to patch
"
+
original
.
Name
);
}
}
}
...
...
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