Fix Client RoleSystem not inheriting SharedRoleSystem, network job component (#21436)
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Roles.Jobs;
|
||||
|
||||
/// <summary>
|
||||
/// Added to mind entities to hold the data for the player's current job.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class JobComponent : Component
|
||||
{
|
||||
[DataField("prototype", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<JobPrototype>))]
|
||||
public string? PrototypeId;
|
||||
[DataField(required: true), AutoNetworkedField]
|
||||
public ProtoId<JobPrototype>? Prototype;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public abstract class SharedJobSystem : EntitySystem
|
||||
|
||||
public bool MindHasJobWithId(EntityUid? mindId, string prototypeId)
|
||||
{
|
||||
return CompOrNull<JobComponent>(mindId)?.PrototypeId == prototypeId;
|
||||
return CompOrNull<JobComponent>(mindId)?.Prototype == prototypeId;
|
||||
}
|
||||
|
||||
public bool MindTryGetJob(
|
||||
@@ -95,8 +95,8 @@ public abstract class SharedJobSystem : EntitySystem
|
||||
prototype = null;
|
||||
|
||||
return TryComp(mindId, out comp) &&
|
||||
comp.PrototypeId != null &&
|
||||
_prototypes.TryIndex(comp.PrototypeId, out prototype);
|
||||
comp.Prototype != null &&
|
||||
_prototypes.TryIndex(comp.Prototype, out prototype);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -25,7 +25,7 @@ public abstract class SharedRoleSystem : EntitySystem
|
||||
{
|
||||
var name = "game-ticker-unknown-role";
|
||||
string? playTimeTracker = null;
|
||||
if (component.PrototypeId != null && _prototypes.TryIndex(component.PrototypeId, out JobPrototype? job))
|
||||
if (component.Prototype != null && _prototypes.TryIndex(component.Prototype, out JobPrototype? job))
|
||||
{
|
||||
name = job.Name;
|
||||
playTimeTracker = job.PlayTimeTracker;
|
||||
|
||||
Reference in New Issue
Block a user