fix(core): Cleans up OPL code (#396)

- [X] Cleans up OPL code to simplify the calls
This commit is contained in:
Kamron Batman 2021-01-09 11:56:05 -08:00 • committed by GitHub
parent 5882b1ab3f
commit 0b9fb9c071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 70 deletions

View file

@ -880,19 +880,11 @@ namespace Server.Multis
DesignState.SendDetailedInfoTo(ns);
}
public override void SendInfoTo(NetState ns, bool sendOplPacket)
{
base.SendInfoTo(ns, sendOplPacket);
var stateToSend = DesignContext.Find(ns.Mobile)?.Foundation == this ? DesignState : CurrentState;
stateToSend.SendGeneralInfoTo(ns);
}
public override void SendInfoTo(NetState ns, ReadOnlySpan<byte> world, Span<byte> opl)
public override void SendInfoTo(NetState ns, ReadOnlySpan<byte> world = default, Span<byte> opl = default)
{
base.SendInfoTo(ns, world, opl);
var stateToSend = DesignContext.Find(ns.Mobile)?.Foundation == this ? DesignState : CurrentState;
var stateToSend = DesignContext.Find(ns?.Mobile)?.Foundation == this ? DesignState : CurrentState;
stateToSend.SendGeneralInfoTo(ns);
}