-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add sync for stalkers #2255
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
base: master
Are you sure you want to change the base?
Add sync for stalkers #2255
Conversation
24c8a58 to
19d2afe
Compare
7029e10 to
f916df4
Compare
f916df4 to
b47a533
Compare
This comment has been minimized.
This comment has been minimized.
f98dea9 to
8844ac0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
NitroxClient/GameLogic/Spawning/Metadata/Extractor/StayAtLeashPositionMetadataExtractor.cs:7
- The class name 'StayAtLeastPositionMetadataExtractor' appears inconsistent with the metadata type 'StayAtLeashPositionMetadata'; renaming it to 'StayAtLeashPositionMetadataExtractor' would improve clarity.
public sealed class StayAtLeastPositionMetadataExtractor : EntityMetadataExtractor<Creature, StayAtLeashPositionMetadata>
8844ac0 to
50240e7
Compare
NitroxPatcher/Patches/Dynamic/PrisonPredatorSwimToPlayer_Perform_Patch.cs
Outdated
Show resolved
Hide resolved
NitroxPatcher/Patches/Dynamic/PrisonPredatorSwimToPlayer_Perform_Patch.cs
Show resolved
Hide resolved
ae17e14 to
0d25ae2
Compare
0d25ae2 to
063426c
Compare
NitroxPatcher/Patches/Dynamic/PrisonPredatorSwimToPlayer_Perform_Patch.cs
Show resolved
Hide resolved
| public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) | ||
| { | ||
| yield return new CodeInstruction(OpCodes.Ldarg_0); | ||
| yield return new CodeInstruction(OpCodes.Ldarg_1); | ||
| yield return new CodeInstruction(OpCodes.Ldarg_2); | ||
| yield return new CodeInstruction(OpCodes.Call, Reflect.Method(() => Perform(default, default, default))); | ||
| yield return new CodeInstruction(OpCodes.Ret); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that it's fairly doable to do a little transpiler magic to just replace the local transform(stloc.1) and targetDirection(stloc..2) variables with the once from the lastTarget, no?
| instance.swimBehaviour.SwimTo(targetTransform.position, instance.swimVelocity); | ||
| creature.TryGetNitroxId(out NitroxId nitroxId); | ||
|
|
||
| Log.InGame($"[PrisonPredatorSwimTo Swim] {creature.name} {nitroxId?.ToString()} {lastTarget.target.name}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed debug logging
NitroxPatcher/Patches/Dynamic/PrisonPredatorSwimToPlayer_Evaluate_Patch.cs
Outdated
Show resolved
Hide resolved
NitroxPatcher/Patches/Dynamic/PrisonPredatorSwimToPlayer_Evaluate_Patch.cs
Outdated
Show resolved
Hide resolved
NitroxPatcher/Patches/Dynamic/PrisonPredatorSwimToPlayer_Evaluate_Patch.cs
Outdated
Show resolved
Hide resolved
| creature.TryGetNitroxId(out NitroxId nitroxId); | ||
|
|
||
| Log.InGame($"[PrisonPredatorSwimTo Eval] {creature.name} {nitroxId?.ToString()} {gameobject.name}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover debug logging
| yield return new CodeInstruction(OpCodes.Ldarg_0); | ||
| yield return new CodeInstruction(OpCodes.Ldarg_1); | ||
| yield return new CodeInstruction(OpCodes.Ldarg_2); | ||
| yield return new CodeInstruction(OpCodes.Call, Reflect.Method(() => EvaluatePriority(default, default, default))); | ||
| yield return new CodeInstruction(OpCodes.Ret); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in PrisonPredatorSwimToPlayer_Perform_Patch I think we can manipulated the IL to get the same outcome.
Creating a new local variable, filling it with the ecoTarget and then replacing all usings of the Player local variable with the new one should work.
|
This comment was marked as spam.
This comment was marked as spam.
063426c to
025ee09
Compare
CreatureFlinchCreatureFearPrisonCreatureBehaviourAvoidObstaclesStayAtLeashPositionWill need work after this PR :
Closes #2250
Closes #2243