faint
faint
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
heartowo
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
thanks once again!
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
though now I’m really curious how IoC works
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
Just had to use so called entitymanager to get the system
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
Appreciate your help @mtreit @ZZZZZZZZZZZZZZZZZZZZZZZZZ
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
it finally works!
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
Cause I can surely say it works fine for _EntitySystem_s
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
also I just think that Dependency thing doesn’t work in classes that inherit Node.
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
I didn’t get what exactly is null
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
like uh
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
the main reason I asked it here is cause the error didn’t seem clear to me
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
Currently trying another thing of getting a system for my class
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
yeah, was going to visit a IoC docs page after I finish the thing Im working currently on lol
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
can’t answer since I don’t know much about IoC and stuff sorry
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
a game engine for SS14
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
It’s RobustToolbox
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
I shift+clicked it and here is the code
using System;

namespace Robust.Shared.IoC
{
/// <summary>
/// Specifies that the field this is applied to is a dependency,
/// which will be resolved by <see cref="IoCManager" /> when the containing class is instantiated.
/// </summary>
/// <remarks>
/// <para>
/// The dependency is resolved as if <see cref="IoCManager.Resolve{T}()" /> were to be called,
/// but it avoids circular references and init order issues due to internal code in the <see cref="IoCManager" />.
/// </para>
/// <para>
/// The dependency can be injected into read only fields without issues,
/// and as a matter of fact it is recommended to use read only fields.
/// </para>
/// <para>
/// If you would like to run code after the dependencies have been injected, use <see cref="IPostInjectInit" />
/// </para>
/// </remarks>
[AttributeUsage(AttributeTargets.Field)]
public sealed class DependencyAttribute : Attribute
{
}
}
using System;

namespace Robust.Shared.IoC
{
/// <summary>
/// Specifies that the field this is applied to is a dependency,
/// which will be resolved by <see cref="IoCManager" /> when the containing class is instantiated.
/// </summary>
/// <remarks>
/// <para>
/// The dependency is resolved as if <see cref="IoCManager.Resolve{T}()" /> were to be called,
/// but it avoids circular references and init order issues due to internal code in the <see cref="IoCManager" />.
/// </para>
/// <para>
/// The dependency can be injected into read only fields without issues,
/// and as a matter of fact it is recommended to use read only fields.
/// </para>
/// <para>
/// If you would like to run code after the dependencies have been injected, use <see cref="IPostInjectInit" />
/// </para>
/// </remarks>
[AttributeUsage(AttributeTargets.Field)]
public sealed class DependencyAttribute : Attribute
{
}
}
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
that also works
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
I might wanna do another way
51 replies
CC#
Created by faint on 6/27/2023 in #help
System.NullReferenceException in an if statement
I just don't know why it doesn't work only with my system if that way of getting a system is used everywhere in the solution
51 replies