StatusEffects ignore components that are not there anymore, when removing effects
This commit is contained in:
@@ -216,6 +216,12 @@ namespace Content.Shared.StatusEffect
|
||||
if (state.RelevantComponent != null)
|
||||
{
|
||||
var type = _componentFactory.GetRegistration(state.RelevantComponent).Type;
|
||||
|
||||
// Make sure the component is actually there first.
|
||||
// Maybe a badmin badminned the component away,
|
||||
// or perhaps, on the client, the component deletion sync
|
||||
// was faster than prediction could predict. Either way, let's not assume the component exists.
|
||||
if(EntityManager.HasComponent(uid, type))
|
||||
EntityManager.RemoveComponent(uid, type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user