Okay here is crash report
RunUO Version 0.5, Build 5368.35672
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.34014
Time: 10/1/2014 10:51:34 PM
Mobiles: 20
Items: 476
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from)
at Server.Mobiles.PlayerMobile.SickTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)

here is the ontick im getting crash from

Code:
publicclassSickTimer : Timer
{
private PlayerMobile m_defender;
privateint cnt = 0;
privateint m_count = 0;
privateint m_countmax;
public SickTimer(PlayerMobile defender, int count)
: base(TimeSpan.Zero, TimeSpan.FromSeconds(defender.SD), count)
{
this.Priority = TimerPriority.TenMS;
m_defender = (PlayerMobile)defender;
m_countmax = count;
}
protectedoverridevoid OnTick()
{
if (m_defender == null)
{
m_defender.Sick = false;
m_defender.Contagious = false;
Stop();
}
if (!m_defender.Alive)
{
m_defender.Sick = false;
m_defender.Contagious = false;
m_defender.SendMessage("You are no longer sick!");
Stop();
}
if ((!m_defender.Sick) || (m_defender.SicknessType == SickType.None))
Stop();
if (m_defender.SicknessType == SickType.Headache)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.HMN, m_defender.HMX));
//m_defender.Mana -= 1;
if (cnt > 2)
{
m_defender.SendMessage("You have a bad headache!");
m_defender.Emote("*head throbbing*");
if (!m_defender.Female)
m_defender.PlaySound(0x42B);
else
m_defender.PlaySound(0x31B);
cnt = 0;
}
m_defender.CloseGump(typeof(HeadacheBlue));
if (m_defender.HasGump(typeof(HeadacheRed)))
{
m_defender.CloseGump(typeof(HeadacheRed));
m_defender.SendGump(new HeadacheBlue());
return;
}
m_defender.SendGump(new HeadacheRed());
}
if (m_defender.SicknessType == SickType.Cold)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.CMN, m_defender.CMX));
m_defender.Stam -= 2;
m_defender.Mana -= 1;
if (cnt > 2)
{
m_defender.SendMessage("You have a cold!");
m_defender.Emote("cough*cough");
if (!m_defender.Female)
m_defender.PlaySound(0x420);
else
m_defender.PlaySound(0x311);
cnt = 0;
}
m_defender.CloseGump(typeof(ColdBlue));
if (m_defender.HasGump(typeof(ColdRed)))
{
m_defender.CloseGump(typeof(ColdRed));
m_defender.SendGump(new ColdBlue());
return;
}
m_defender.SendGump(new ColdRed());
}
if (m_defender.SicknessType == SickType.Flu)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.FMN, m_defender.FMX));
m_defender.Stam -= 4;
m_defender.Mana -= 2;
if (cnt > 2)
{
m_defender.SendMessage("You have influenza!");
m_defender.Emote("*feels feverish*");
if (!m_defender.Female)
m_defender.PlaySound(0x42B);
else
m_defender.PlaySound(0x31B);
cnt = 0;
}
m_defender.CloseGump(typeof(FluBlue));
if (m_defender.HasGump(typeof(FluRed)))
{
m_defender.CloseGump(typeof(FluRed));
m_defender.SendGump(new FluBlue());
return;
}
m_defender.SendGump(new FluRed());
}
if (m_defender.SicknessType == SickType.Virus)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.VMN, m_defender.VMX));
m_defender.Stam -= 8;
m_defender.Mana -= 4;
if (cnt > 2)
{
m_defender.SendMessage("You have a bad virus, you need medical attention!");
m_defender.Emote("*cold chills run your spine*");
m_defender.PlaySound(m_defender.Female ? 813 : 1087);
m_defender.Say("*vomits*");
if (!m_defender.Mounted)
{
m_defender.Animate(32, 5, 1, true, false, 0);
}
Point3D p = new Point3D(m_defender.Location);
p.Z = m_defender.Map.GetAverageZ(p.X, p.Y);
Vomit vomit = new Vomit();
vomit.Map = m_defender.Map;
vomit.Location = p;
cnt = 0;
}
m_defender.CloseGump(typeof(VirusBlue));
if (m_defender.HasGump(typeof(VirusRed)))
{
m_defender.CloseGump(typeof(VirusRed));
m_defender.SendGump(new VirusBlue());
return;
}
m_defender.SendGump(new VirusRed());
}
if (m_defender.SicknessType == SickType.Plague)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.PMN, m_defender.PMX));
m_defender.Stam -= 20;
m_defender.Mana -= 10;
if (cnt > 2)
{
m_defender.SendMessage("You have the plague, you'll infect others upon contact!");
m_defender.Emote("*hot flashes make you dizzy*");
m_defender.PlaySound(m_defender.Female ? 813 : 1087);
m_defender.Say("*pukes*");
if (!m_defender.Mounted)
{
m_defender.Animate(32, 5, 1, true, false, 0);
}
Point3D p = new Point3D(m_defender.Location);
p.Z = m_defender.Map.GetAverageZ(p.X, p.Y);
Puke puke = new Puke();
puke.Map = m_defender.Map;
puke.Location = p;
cnt = 0;
}
m_defender.CloseGump(typeof(PlagueBlue));
if (m_defender.HasGump(typeof(PlagueRed)))
{
m_defender.CloseGump(typeof(PlagueRed));
m_defender.SendGump(new PlagueBlue());
return;
}
m_defender.SendGump(new PlagueRed());
}
if (m_defender.SicknessType == SickType.Disease)
{
cnt += 1;
m_count += 1;
m_defender.Damage(Utility.Random(m_defender.DMN, m_defender.DMX));
m_defender.Stam -= 20;
m_defender.Mana -= 10;
if (cnt > 2)
{
m_defender.SendMessage("You have a bad disease, seek medical attention!");
m_defender.Emote("*feels deathly ill*");
m_defender.PlaySound(m_defender.Female ? 813 : 1087);
m_defender.Say("*pukes*");
if (!m_defender.Mounted)
{
m_defender.Animate(32, 5, 1, true, false, 0);
}
Point3D p = new Point3D(m_defender.Location);
p.Z = m_defender.Map.GetAverageZ(p.X, p.Y);
Puke puke = new Puke();
puke.Map = m_defender.Map;
puke.Location = p;
cnt = 0;
}
m_defender.CloseGump(typeof(DiseaseBlue));
if (m_defender.HasGump(typeof(DiseaseRed)))
{
m_defender.CloseGump(typeof(DiseaseRed));
m_defender.SendGump(new DiseaseBlue());
return;
}
m_defender.SendGump(new DiseaseRed());
}
if (m_count == m_countmax)
{
m_defender.SicknessType = SickType.None;
m_defender.Sick = false;
SickGumpCheck(m_defender);
Stop();
return;
}
int randominfect = Utility.Random(1, 99);
ArrayList RI = newArrayList();
foreach (Mobile o in m_defender.Map.GetMobilesInRange(m_defender.Location, m_defender.CTR))
{
RI.Add(o);
}
for (int i = 0; i < RI.Count; i++)
{
Mobile o = RI[i] as Mobile;
if (o is PlayerMobile && m_defender != o && m_defender.SicknessType == SickType.Plague)
{
PlayerMobile mob = (PlayerMobile)o;
if ((!mob.Contagious) || (mob.Sick == true))
{
}
elseif (mob.SicknessType == SickType.None)
{
if (randominfect > 5 && randominfect < 95)
mob.SicknessType = m_defender.SicknessType;
}
}
if (o is PlayerMobile && m_defender != o)
{
PlayerMobile mob = (PlayerMobile)o;
if ((!mob.Contagious) || (mob.Sick == true))
{
}
elseif (mob.SicknessType == SickType.None)
{
if (randominfect > 43 && randominfect < 50)
mob.SicknessType = m_defender.SicknessType;
}
}
}
}
}


[code]
 

Check this section out.
Code:
m_defender.CloseGump(typeof(HeadacheBlue));
if (m_defender.HasGump(typeof(HeadacheRed)))
{
m_defender.CloseGump(typeof(HeadacheRed));
m_defender.SendGump(new HeadacheBlue());
return;
}
m_defender.SendGump(new HeadacheRed());
}[/B][/B]
 
I did a debug mode and this says my line

at Server.Mobiles.PlayerMobile.SickTimer.OnTick() in c:\Users\unfor_001\Desktop\Distant Land\Scripts\Mobiles\PlayerMobile.cs:line 672
that is this line

m_defender.Damage(Utility.Random(m_defender.HMN, m_defender.HMX));
 
Code:
if (m_defender == null)
{
m_defender.Sick = false;
m_defender.Contagious = false;
Stop();
}

Pretty sure if m_defender == null, attempting to set Sick/Contagious properties would cause a crash, since m_defender is null.
 
I don't really script but I agree with Arvoreen. I think you need a lot more Null checks in that script. Trying to apply attributes to a non-existant mob is a great way to crash things.
 
im not applying it to npcs just players its gd13 sickness system last one he released.. I think I found out the problem I haven't had a crash from it untell I added his last release of the hunting system this where the crash is coming from I thought it was the ontick part

here is where the crash happens at after hard looking I found it
Code:
#region HS_Start_4*/
BaseCreature bc = from as BaseCreature;
if (this == null)
return;
if (bc != null && Hunting)
{
if ((bc.IsEasy || bc.IsHard || bc.IsExtreme || bc.IsGod) && bc.Combatant != this)
{
amount = (int)(amount -= amount);
bc.Damage(amount, bc);
}
}
if ((bc.IsEasy || bc.IsHard || bc.IsExtreme || bc.IsGod) && bc.Combatant != this)
{
amount = (int)(amount -= amount);
bc.Damage(amount, bc);
}
#endregion
 
yes that is the crash point I commented it out and my server is running fine.... i don't see what i am missing but i am looking hard any help would be awesome..
 
hmm, it looks like lines 14-18 are repeated and not within your null check on bc. If that snippet of code is how it is in your script I would get rid of those extra lines as it appears as if they already exist within your bc null check.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back