Skip to content

Commit 266ba2e

Browse files
committed
Fix nullable warnings and wrongly added using
1 parent 8788b0e commit 266ba2e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

WowPacketParser/Enums/Version/UpdateFields.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class UpdateFieldInfo
1616
public string Name;
1717
public int Size;
1818
public UpdateFieldType Format;
19-
public Type? EnumType;
19+
public Type EnumType;
2020
}
2121

2222
public static class UpdateFields
@@ -87,12 +87,12 @@ private static bool LoadUFDictionariesInto(Dictionary<Type, SortedList<int, Upda
8787

8888
for (int i = 0; i < vValues.Length; ++i)
8989
{
90-
UpdateFieldAttribute? attribute = (UpdateFieldAttribute)ufEnumType.GetMember(vNames[i])
90+
UpdateFieldAttribute attribute = (UpdateFieldAttribute)ufEnumType.GetMember(vNames[i])
9191
.SelectMany(member => member.GetCustomAttributes(typeof(UpdateFieldAttribute), false))
9292
.Where(attribute => ((UpdateFieldAttribute)attribute).Version <= ClientVersion.VersionDefiningBuild)
9393
.OrderByDescending(attribute => ((UpdateFieldAttribute)attribute).Version).FirstOrDefault();;
9494
UpdateFieldType format = attribute?.UFAttribute ?? UpdateFieldType.Default;
95-
Type? enumType = attribute?.EnumType ?? null;
95+
Type enumType = attribute?.EnumType ?? null;
9696

9797
result.Add((int)vValues.GetValue(i), new UpdateFieldInfo() { Value = (int)vValues.GetValue(i), Name = vNames[i], Size = 0, Format = format, EnumType = enumType });
9898
namesResult.Add(vNames[i], (int)vValues.GetValue(i));

WowPacketParser/Parsing/Parsers/UpdateHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Google.Protobuf.WellKnownTypes;
21
using System;
32
using System.Collections;
43
using System.Collections.Generic;
@@ -352,7 +351,7 @@ private static Dictionary<int, UpdateField> ReadValuesUpdateBlock(Packet packet,
352351
int start = i;
353352
int size = 1;
354353
UpdateFieldType updateFieldType = UpdateFieldType.Default;
355-
System.Type? enumType = null;
354+
System.Type enumType = null;
356355
if (fieldInfo != null)
357356
{
358357
key = fieldInfo.Name;

WowPacketParser/Parsing/UpdateFieldAttributes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public UpdateFieldAttribute(UpdateFieldType attrib, Type enumType)
4040
EnumType = enumType;
4141
}
4242

43-
public UpdateFieldAttribute(UpdateFieldType attrib, ClientVersionBuild fromVersion, Type? enumType)
43+
public UpdateFieldAttribute(UpdateFieldType attrib, ClientVersionBuild fromVersion, Type enumType)
4444
{
4545
UFAttribute = attrib;
4646
Version = fromVersion;
@@ -49,6 +49,6 @@ public UpdateFieldAttribute(UpdateFieldType attrib, ClientVersionBuild fromVersi
4949

5050
public UpdateFieldType UFAttribute { get; private set; }
5151
public ClientVersionBuild Version { get; private set; }
52-
public Type? EnumType { get; private set; }
52+
public Type EnumType { get; private set; }
5353
}
5454
}

0 commit comments

Comments
 (0)