espcevan
Sorceror
I found a bug that crashes my server.
When
Server Crash Report
===================
RunUO Version 2.2, Build 4782.3756
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 2.0.50727.5477
Time: 5/26/2014 9:24:18 PM
Mobiles: 38867
Items: 204363
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.SkillHandlers.ImbuingGump.InternalTargetD.OnTarget(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
Here is the unedited code from Imbuing.cs where the Imbue Last Prop target gets called on
When
- Someone first imbues something
- Reopens the main Imbue page
- Clicks "Imbue Last Property"
- and then click themselves
Server Crash Report
===================
RunUO Version 2.2, Build 4782.3756
Operating System: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework: 2.0.50727.5477
Time: 5/26/2014 9:24:18 PM
Mobiles: 38867
Items: 204363
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.SkillHandlers.ImbuingGump.InternalTargetD.OnTarget(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
Here is the unedited code from Imbuing.cs where the Imbue Last Prop target gets called on
Code:
// ===== Imbue Target with Last Prop ====================
public static void ImbueLastProp(Mobile from, int Mod, int Mint)
{
from.Target = new InternalTargetD();
return;
}
// ===== Targetting ===== Imbue Last Mod =====
private class InternalTargetD : Target
{
public InternalTargetD() : base(2, false, TargetFlags.None)
{
AllowNonlocal = true;
}
protected override void OnTarget(Mobile from, object o)
{
PlayerMobile pm = from as PlayerMobile;
int Imod = pm.Imbue_Mod;
int ImodInt = pm.Imbue_ModInt;
Item it = o as Item;
// = Item has been Imbued 20 or more times
if (o is BaseWeapon) { BaseWeapon Ti = o as BaseWeapon; if (Ti.TimesImbued >= 20) { from.SendMessage("This item has been modified too many times and cannot be imbued any further."); return; } }
if (o is BaseArmor) { BaseArmor Ti = o as BaseArmor; if (Ti.TimesImbued >= 20) { from.SendMessage("This item has been modified too many times and cannot be imbued any further."); return; } }
if (o is BaseJewel) { BaseJewel Ti = o as BaseJewel; if (Ti.TimesImbued >= 20) { from.SendMessage("This item has been modified too many times and cannot be imbued any further."); return; } }
if (o is BaseHat) { BaseHat Ti = o as BaseHat; if (Ti.TimesImbued >= 20) { from.SendMessage("This item has been modified too many times and cannot be imbued any further."); return; } }
if (it.LootType == LootType.Blessed)
{
from.SendLocalizedMessage(1080438); // You cannot imbue a blessed item.
return;
}
// = Check Last Mod can be applied to Targeted Item Type
if (o is BaseMeleeWeapon)
{
if (Imod == 1 || Imod == 2 || Imod == 12 || Imod == 13 || Imod == 16 || Imod == 21 || Imod == 22 || (Imod >= 25 && Imod <= 41) || Imod >= 101)
{
ImbuingGumpC.ImbueItem(from, o, Imod, ImodInt);
from.SendGump(new ImbuingGump(from));
return;
}
else
from.SendMessage("The selected item cannot be Imbued with the last Property..");
}
else if (o is BaseRanged)
{
if (Imod == 1 || Imod == 2 || Imod == 12 || Imod == 13 || Imod == 16 || Imod == 21 || Imod == 22 || Imod == 60 || Imod == 61 || (Imod >= 25 && Imod <= 41) || Imod >= 101)
{
ImbuingGumpC.ImbueItem(from, o, Imod, ImodInt);
from.SendGump(new ImbuingGump(from));
return;
}
else
from.SendMessage("The selected item cannot be Imbued with the last Property..");
}
else if (o is BaseShield)
{
if (Imod == 1 || Imod == 2 || Imod == 19 || Imod == 16 || Imod == 22 || Imod == 24 || Imod == 42)
{
ImbuingGumpC.ImbueItem(from, o, Imod, ImodInt);
from.SendGump(new ImbuingGump(from));
return;
}
else
from.SendMessage("The selected item cannot be Imbued with the last Property..");
}
else if (o is BaseArmor)
{
if (Imod == 3 || Imod == 4 || Imod == 5 || Imod == 9 || Imod == 10 || Imod == 11 || Imod == 21 || Imod == 23 || (Imod >= 17 && Imod <= 19))
{
ImbuingGumpC.ImbueItem(from, o, Imod, ImodInt);
from.SendGump(new ImbuingGump(from));
return;
}
else
from.SendMessage("The selected item cannot be Imbued with the last Property..");
}
else if (o is BaseHat)
{
if (Imod == 3 || Imod == 4 || Imod == 5 || Imod == 9 || Imod == 10 || Imod == 11 || Imod == 21 || Imod == 23 || (Imod >= 17 && Imod <= 19))
{
ImbuingGumpC.ImbueItem(from, o, Imod, ImodInt);
from.SendGump(new ImbuingGump(from));
return;
}
else
from.SendMessage("The selected item cannot be Imbued with the last Property..");
}
else if (o is BaseJewel)
{
if (Imod == 1 || Imod == 2 || Imod == 6 || Imod == 7 || Imod == 8 || Imod == 12 || Imod == 10 || Imod == 11 || Imod == 20 || Imod == 21 || Imod == 23 || Imod == 21 || (Imod >= 14 && Imod <= 18) || (Imod >= 51 && Imod <= 55) || Imod >= 151)
{
ImbuingGumpC.ImbueItem(from, o, Imod, ImodInt);
from.SendGump(new ImbuingGump(from));
return;
}
else
from.SendMessage("The selected item cannot be Imbued with the last Property..");
}
else
from.SendMessage("The selected item cannot be Imbued with the last Property..");
return;
}
}