Added nullable to most Content.Shared files (#3238)
* Add nullable to some Content.Shared files. * Use [NotNullWhen(true)] * Undo adding now redundant !'s * Forgot one * Add a ton more nullable * You can guess * Fix some issues * It actually compiles now * Auto stash before merge of "null2" and "origin/master" * I lied * enable annotations -> enable * Revert ActionBlockerSystem.cs to original * Fix ActionBlockerSystem.cs * More nullable * Undo some added exclamation marks * Fix issues * Update Content.Shared/Maps/ContentTileDefinition.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Resolve some issues * Remove unused method * Fix more issues * Fix more issues * Fix more issues * Fix more issues * Fix issue, rollback SharedGhostComponent.cs * Update submodule * Fix issue, invert some if-statements to reduce nesting * Revert RobustToolbox * FIx things broken by merge * Some fixes - Replaced with string.Empty - Remove some exclamation marks - Revert file * Some fixes * Trivial #nullable enable * Fix null ables Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
#nullable enable
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using Robust.Shared.Players;
|
||||
|
||||
namespace Content.Shared.GameObjects.Components.Movement
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.Containers;
|
||||
#nullable enable
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -58,7 +59,7 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
public static void RefreshItemModifiers(IEntity item)
|
||||
{
|
||||
if (item.TryGetContainer(out var container) &&
|
||||
container.Owner.TryGetComponent(out MovementSpeedModifierComponent mod))
|
||||
container.Owner.TryGetComponent(out MovementSpeedModifierComponent? mod))
|
||||
{
|
||||
mod.RefreshMovementSpeedModifiers();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
#nullable enable
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
|
||||
using Content.Shared.Physics;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -12,14 +13,14 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
public sealed override string Name => "Climbing";
|
||||
public sealed override uint? NetID => ContentNetIDs.CLIMBING;
|
||||
|
||||
protected IPhysicsComponent Body;
|
||||
protected bool IsOnClimbableThisFrame = false;
|
||||
protected IPhysicsComponent? Body;
|
||||
protected bool IsOnClimbableThisFrame;
|
||||
|
||||
protected bool OwnerIsTransitioning
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Body.TryGetController<ClimbController>(out var controller))
|
||||
if (Body != null && Body.TryGetController<ClimbController>(out var controller))
|
||||
{
|
||||
return controller.IsActive;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
@@ -57,9 +58,9 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
if (!Slippery
|
||||
|| Owner.IsInContainer()
|
||||
|| _slipped.Contains(entity.Uid)
|
||||
|| !entity.TryGetComponent(out SharedStunnableComponent stun)
|
||||
|| !entity.TryGetComponent(out IPhysicsComponent otherBody)
|
||||
|| !Owner.TryGetComponent(out IPhysicsComponent body))
|
||||
|| !entity.TryGetComponent(out SharedStunnableComponent? stun)
|
||||
|| !entity.TryGetComponent(out IPhysicsComponent? otherBody)
|
||||
|| !Owner.TryGetComponent(out IPhysicsComponent? body))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -81,7 +82,7 @@ namespace Content.Shared.GameObjects.Components.Movement
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out IPhysicsComponent physics))
|
||||
if (entity.TryGetComponent(out IPhysicsComponent? physics))
|
||||
{
|
||||
var controller = physics.EnsureController<SlipController>();
|
||||
controller.LinearVelocity = physics.LinearVelocity * LaunchForwardsMultiplier;
|
||||
|
||||
Reference in New Issue
Block a user