fix(core): Updates slice with range selectors (#583)
- [X] Replaces Span slicing with range selection - [X] Replaces string slicing with range selection
This commit is contained in:
parent
9f9d990f85
commit
a0893b68c0
62 changed files with 363 additions and 382 deletions
|
|
@ -1150,7 +1150,7 @@ namespace Server
|
|||
var length = OutgoingEntityPackets.CreateWorldEntity(hsWorldItem, this, true);
|
||||
if (length != hsWorldItem.Length)
|
||||
{
|
||||
hsWorldItem = hsWorldItem.SliceToLength(length);
|
||||
hsWorldItem = hsWorldItem[..length];
|
||||
}
|
||||
|
||||
SendInfoTo(state, hsWorldItem, opl);
|
||||
|
|
@ -1160,7 +1160,7 @@ namespace Server
|
|||
var length = OutgoingEntityPackets.CreateWorldEntity(saWorldItem, this, false);
|
||||
if (length != saWorldItem.Length)
|
||||
{
|
||||
saWorldItem = saWorldItem.SliceToLength(length);
|
||||
saWorldItem = saWorldItem[..length];
|
||||
}
|
||||
|
||||
SendInfoTo(state, saWorldItem, opl);
|
||||
|
|
@ -1170,7 +1170,7 @@ namespace Server
|
|||
var length = OutgoingItemPackets.CreateWorldItem(oldWorldItem, this);
|
||||
if (length != oldWorldItem.Length)
|
||||
{
|
||||
oldWorldItem = oldWorldItem.SliceToLength(length);
|
||||
oldWorldItem = oldWorldItem[..length];
|
||||
}
|
||||
|
||||
SendInfoTo(state, oldWorldItem, opl);
|
||||
|
|
@ -3330,7 +3330,7 @@ namespace Server
|
|||
|
||||
if (length != buffer.Length)
|
||||
{
|
||||
buffer = buffer.SliceToLength(length); // Adjust to the actual size
|
||||
buffer = buffer[..length]; // Adjust to the actual size
|
||||
}
|
||||
|
||||
state.Send(buffer);
|
||||
|
|
@ -3364,7 +3364,7 @@ namespace Server
|
|||
|
||||
if (length != buffer.Length)
|
||||
{
|
||||
buffer = buffer.SliceToLength(length); // Adjust to the actual size
|
||||
buffer = buffer[..length]; // Adjust to the actual size
|
||||
}
|
||||
|
||||
state.Send(buffer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue