TIL the 'is' declaration pattern
This commit is contained in:
@@ -491,9 +491,9 @@ namespace UIFixes
|
|||||||
[PatchPostfix]
|
[PatchPostfix]
|
||||||
private static void Postfix(DraggedItemView __instance, ItemContextAbstractClass itemUnderCursor)
|
private static void Postfix(DraggedItemView __instance, ItemContextAbstractClass itemUnderCursor)
|
||||||
{
|
{
|
||||||
if (SourceContainer is Component)
|
if (SourceContainer is Component sourceComponent)
|
||||||
{
|
{
|
||||||
ItemSpecificationPanel panel = (SourceContainer as Component).GetComponentInParent<ItemSpecificationPanel>();
|
ItemSpecificationPanel panel = sourceComponent.GetComponentInParent<ItemSpecificationPanel>();
|
||||||
if (panel != null)
|
if (panel != null)
|
||||||
{
|
{
|
||||||
Slot slot = SlotItemAddressSlotField.GetValue(__instance.ItemAddress) as Slot;
|
Slot slot = SlotItemAddressSlotField.GetValue(__instance.ItemAddress) as Slot;
|
||||||
|
|||||||
Reference in New Issue
Block a user