Full Version : Crash help
xmlspawner >>Scripting Support >>Crash help
<< Prev | Next >>
Grimhawk- 07-17-2006
I updated the turboslots and they compile fine and seemed to be working fine until I took two steps away from the slot with the gump open.

CODE
Server Crash Report =================== RunUO Version 2.0, Build 2357.32527 Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2 .NET Framework: 2.0.50727.42
Time: 7/17/2006 11:56:29 PM
Mobiles: 5608
Items: 105472
Clients:
- Count: 1
+ xxx.xxx.x.xx: (account = Grim) (mobile = 0x27 'Grim')
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Items.TurboSlot.OnMovement(Mobile m, Point3D oldLocation) in c:\Documents and Settings\Owner\My Documents\RunUO-2.0-RC1\Scripts\Custom\Items\Turboslots\turboslot1\turboslot.cs:line 1068
at Server.Mobile.Move(Direction d)
at Server.Mobiles.PlayerMobile.Move(Direction d) in c:\Documents and Settings\Owner\My Documents\RunUO-2.0-RC1\Scripts\Mobiles\PlayerMobile.cs:line 1106
at Server.Network.PacketHandlers.MovementReq(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 code that caused the crash.

CODE
m_InUseBy.CloseGump(typeof(NewMinerBonusGump));

and

CODE
if (m_Won != 0)

I didn't even have the minermadness slot added ingame so not sure why its refering to the miner bonus gump.
Any ideas Arte?
ArteGordon- 07-18-2006
you need to change this

CODE
if (!m_InUseBy.InRange(GetWorldLocation(), 3) || m_InUseBy.Map == Map.Internal) { m_InUseBy.CloseGump(typeof(TurboSlotGump)); m_InUseBy.CloseGump(typeof(NewMinerBonusGump)); m_InUseBy.CloseGump(typeof(TurboSlotPayTableGump));
m_InUseBy.SendMessage("You have walked away from the slot machine, others may now use it.");
if (m_Won != 0)
{
m_InUseBy.PlaySound(52);
m_InUseBy.SendMessage("Hey, you left some cash in the machine! Cashing out.");
DoCashOut(m_InUseBy); // Give them their winnings
}
InUseBy = null;

to this

CODE
if (!m_InUseBy.InRange(GetWorldLocation(), 3) || m_InUseBy.Map == Map.Internal) { Mobile from = m_InUseBy; from.CloseGump(typeof(TurboSlotGump)); from.CloseGump(typeof(NewMinerBonusGump));
from.CloseGump(typeof(TurboSlotPayTableGump));
from.SendMessage("You have walked away from the slot machine, others may now use it.");
if (m_Won != 0)
{
from.PlaySound(52);
from.SendMessage("Hey, you left some cash in the machine! Cashing out.");
DoCashOut(from); // Give them their winnings
}
InUseBy = null;
}

the problem is that the gump OnResponse to closing the gump sets InUseBy to null.
Grimhawk- 07-18-2006
Thanks Arte that fixed it.