Player post-spawn hook and player ghosting controlled by preset (#2734)
* GamePreset: Add a hook to catch all player spawns for modification. Unless someone makes the entire job system unpluggable, this is what you get... * GamePreset: Is now in control of voluntary ghosting * Clean up ghost code to only rely on a player's Mind
This commit is contained in:
@@ -31,6 +31,7 @@ using Robust.Server.Interfaces.Maps;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Server.ServerStatus;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.Configuration;
|
||||
@@ -440,6 +441,11 @@ namespace Content.Server.GameTicking
|
||||
UpdateJobsAvailable();
|
||||
}
|
||||
|
||||
public bool OnGhostAttempt(Mind mind, bool canReturnGlobal)
|
||||
{
|
||||
return Preset.OnGhostAttempt(mind, canReturnGlobal);
|
||||
}
|
||||
|
||||
public T AddGameRule<T>() where T : GameRule, new()
|
||||
{
|
||||
var instance = _dynamicTypeFactory.CreateInstance<T>();
|
||||
@@ -887,6 +893,8 @@ namespace Content.Server.GameTicking
|
||||
AddSpawnedPosition(jobId);
|
||||
EquipIdCard(mob, character.Name, jobPrototype);
|
||||
jobPrototype.Special?.AfterEquip(mob);
|
||||
|
||||
Preset.OnSpawnPlayerCompleted(session, mob, lateJoin);
|
||||
}
|
||||
|
||||
private void EquipIdCard(IEntity mob, string characterName, JobPrototype jobPrototype)
|
||||
|
||||
Reference in New Issue
Block a user