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

Zombies keep their anomalies on zombification #33867

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Content.Server/Anomaly/Effects/InnerBodyAnomalySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Content.Shared.Mobs;
using Content.Shared.Popups;
using Content.Shared.Whitelist;
using Content.Shared.Zombies;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Physics.Events;
using Robust.Shared.Prototypes;
Expand Down Expand Up @@ -186,6 +187,9 @@ private void OnMobStateChanged(Entity<InnerBodyAnomalyComponent> ent, ref MobSta
if (args.NewMobState != MobState.Dead)
return;

if (EntityManager.HasComponent<PendingZombieComponent>(args.Target))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use HasComp<PendingZombieComponent>(args.Target) instead (Same thing but neater)! Also, what you should probably also do is instead send an event the target seeing if it wants to cancel, and then then the zombie system can listen for that and then cancel it. If you need some examples of how this is done let me know or ask in the discord!

Copy link
Member

@slarticodefast slarticodefast Dec 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, using an event is the right way to go. The way you are doing it you are hardcoding zombies into the anomaly system. If a fork does not have zombies this will break.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! I will make those changes tomorrow.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, @beck-thompson, do you have examples of where to look for how this is done?

return; // Keep your anomaly when becoming a zombie

_anomaly.ChangeAnomalyHealth(ent, -2); //Shutdown it
}

Expand Down
Loading