Some manual GetComponentOrNull inlines

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:09:45 +01:00
parent a5b57c8e10
commit 61be228ad0
10 changed files with 48 additions and 25 deletions

View File

@@ -53,9 +53,11 @@ namespace Content.Server.Administration.Commands
public static void PerformRejuvenate(IEntity target)
{
target.GetComponentOrNull<MobStateComponent>()?.UpdateState(0);
target.GetComponentOrNull<HungerComponent>()?.ResetFood();
target.GetComponentOrNull<ThirstComponent>()?.ResetThirst();
var targetUid = target.Uid;
var entMan = IoCManager.Resolve<IEntityManager>();
entMan.GetComponentOrNull<MobStateComponent>(targetUid)?.UpdateState(0);
entMan.GetComponentOrNull<HungerComponent>(targetUid)?.ResetFood();
entMan.GetComponentOrNull<ThirstComponent>(targetUid)?.ResetThirst();
EntitySystem.Get<StatusEffectsSystem>().TryRemoveAllStatusEffects(target.Uid);