Remove custom OptionalType and use the default c# nullable type.

This commit is contained in:
hondacrx
2022-03-01 17:27:56 -05:00
parent cc08afe269
commit c14f1eb3dc
89 changed files with 924 additions and 976 deletions
+3 -5
View File
@@ -163,12 +163,10 @@ namespace Game.Collision
float liquidLevel = 0;
if (reqLiquidType == 0 || (Global.DB2Mgr.GetLiquidFlags(liquidType) & reqLiquidType) != 0)
if (intersectionCallBack.GetHitModel().GetLiquidLevel(v, intersectionCallBack.GetLocationInfo(), ref liquidLevel))
data.liquidInfo.Set(new AreaAndLiquidData.LiquidInfo(liquidType, liquidLevel));
data.liquidInfo = new AreaAndLiquidData.LiquidInfo(liquidType, liquidLevel);
data.areaInfo.Set(new AreaAndLiquidData.AreaInfo(intersectionCallBack.GetHitModel().GetNameSetId(),
intersectionCallBack.GetLocationInfo().rootId,
(int)intersectionCallBack.GetLocationInfo().hitModel.GetWmoID(),
intersectionCallBack.GetLocationInfo().hitModel.GetMogpFlags()));
data.areaInfo = new(intersectionCallBack.GetHitModel().GetNameSetId(), intersectionCallBack.GetLocationInfo().rootId,
(int)intersectionCallBack.GetLocationInfo().hitModel.GetWmoID(), intersectionCallBack.GetLocationInfo().hitModel.GetMogpFlags());
}
return data;
@@ -260,7 +260,7 @@ namespace Game.Collision
int adtId, rootId, groupId;
uint flags;
if (GetAreaInfo(mapId, x, y, ref data.floorZ, out flags, out adtId, out rootId, out groupId))
data.areaInfo.Set(new AreaAndLiquidData.AreaInfo(adtId, rootId, groupId, flags));
data.areaInfo = new(adtId, rootId, groupId, flags);
return data;
}
var instanceTree = iInstanceMapTrees.LookupByKey(mapId);
@@ -275,10 +275,10 @@ namespace Game.Collision
float liquidLevel = 0;
if (reqLiquidType == 0 || Convert.ToBoolean(Global.DB2Mgr.GetLiquidFlags(liquidType) & reqLiquidType))
if (info.hitInstance.GetLiquidLevel(pos, info, ref liquidLevel))
data.liquidInfo.Set(new AreaAndLiquidData.LiquidInfo(liquidType, liquidLevel));
data.liquidInfo = new(liquidType, liquidLevel);
if (!Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, (byte)DisableFlags.VmapLiquidStatus))
data.areaInfo.Set(new AreaAndLiquidData.AreaInfo(info.hitInstance.adtId, info.rootId, (int)info.hitModel.GetWmoID(), info.hitModel.GetMogpFlags()));
data.areaInfo = new(info.hitInstance.adtId, info.rootId, (int)info.hitModel.GetWmoID(), info.hitModel.GetMogpFlags());
}
}
@@ -422,7 +422,7 @@ namespace Game.Collision
}
public float floorZ = MapConst.VMAPInvalidHeightValue;
public Optional<AreaInfo> areaInfo;
public Optional<LiquidInfo> liquidInfo;
public AreaInfo? areaInfo;
public LiquidInfo? liquidInfo;
}
}