Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -22,23 +22,20 @@ namespace Server.Gumps
AddHtmlLocalized(20, 15, 230, 60, 1046257, true, true); // Are you sure you want to release your pet?
AddButton(20, 80, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(55, 80, 75, 20, 1011011, false, false); // CONTINUE
AddButton(20, 80, 4005, 4007, 2);
AddHtmlLocalized(55, 80, 75, 20, 1011011); // CONTINUE
AddButton(135, 80, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(170, 80, 75, 20, 1011012, false, false); // CANCEL
AddButton(135, 80, 4005, 4007, 1);
AddHtmlLocalized(170, 80, 75, 20, 1011012); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID == 2)
if (!m_Pet.Deleted && m_Pet.Controlled && m_From == m_Pet.ControlMaster &&
m_From.CheckAlive() /*&& m_Pet.CheckControlChance( m_From )*/)
if (m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14))
{
m_Pet.ControlTarget = null;
m_Pet.ControlOrder = OrderType.Release;
}
if (info.ButtonID != 2 || m_Pet.Deleted || !(m_Pet.Controlled && m_From == m_Pet.ControlMaster &&
m_From.CheckAlive() && m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14)))
return;
m_Pet.ControlTarget = null;
m_Pet.ControlOrder = OrderType.Release;
}
}
}
}