Skip to content

Commit

Permalink
Feature flags can be 32-bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Voxpire authored and markdwags committed Sep 12, 2021
1 parent eedfc5b commit bbe92e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Razor/Core/Player.cs
Expand Up @@ -306,7 +306,7 @@ public int MultiVisRange
private int m_Tithe;
private sbyte m_LocalLight;
private byte m_GlobalLight;
private ushort m_Features;
private uint m_Features;
private byte m_Season;
private byte m_DefaultSeason;
private int[] m_MapPatches = new int[10];
Expand Down Expand Up @@ -447,7 +447,7 @@ public PlayerData(BinaryReader reader, int version) : base(reader, version)

m_LocalLight = reader.ReadSByte();
m_GlobalLight = reader.ReadByte();
m_Features = reader.ReadUInt16();
m_Features = reader.ReadUInt32();
m_Season = reader.ReadByte();

if (version >= 4)
Expand Down Expand Up @@ -1073,7 +1073,7 @@ protected override void OnTick()
}
}

public ushort Features
public uint Features
{
get { return m_Features; }
set { m_Features = value; }
Expand Down
9 changes: 7 additions & 2 deletions Razor/Network/Handlers.cs
Expand Up @@ -2719,8 +2719,13 @@ private static void ServerAddress(Packet p, PacketHandlerEventArgs args)

private static void Features(PacketReader p, PacketHandlerEventArgs args)
{
if (World.Player != null)
World.Player.Features = p.ReadUInt16();
if (World.Player != null)
{
if (p.Length > 3)
World.Player.Features = p.ReadUInt32();
else
World.Player.Features = p.ReadUInt16();
}
}

private static void PersonalLight(PacketReader p, PacketHandlerEventArgs args)
Expand Down

0 comments on commit bbe92e8

Please sign in to comment.