Adds test to make sure that calling IComponent.HandleComponentState() with null states does not throw an exception.
Fixes state handling code on components to not throw exceptions when called with null components.
This commit is contained in:
@@ -31,7 +31,8 @@ namespace Content.Client.GameObjects.Components.Mobs
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
var state = (CombatModeComponentState) curState;
|
||||
if (!(curState is CombatModeComponentState state))
|
||||
return;
|
||||
|
||||
IsInCombatMode = state.IsInCombatMode;
|
||||
ActiveZone = state.TargetingZone;
|
||||
|
||||
Reference in New Issue
Block a user