Register for your free account! | Forgot your password?

You last visited: Today at 15:48

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[help] all my erros

Discussion on [help] all my erros within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
[help] all my erros

Quote:
Accoun logging baba IP >--> 5.236.154.198
System.NullReferenceException: Object reference not set to an instance of an object.
at UltimateCo.Character.UseSkill(UInt16 SkillId, UInt16 X, UInt16 Y, UInt32 TargID) in C:\backup Łost\UltimateCo V1.4\UltimateCo V1.4\Character.cs:line 2219
at UltimateCo.Character.Attack() in C:\backup Łost\UltimateCo V1.4\UltimateCo V1.4\Character.cs:line 3196




else if (AtkType == 21)
{
if (SkillLooping != 0)
{
if (SkillLoopingTarget != 0)
{
if (SkillLoopingTarget > 400000 && SkillLoopingTarget < 500000)
{
SingleMob Targ = (SingleMob)Mobs.AllMobs[SkillLoopingTarget];
if (Targ == null || !Targ.Alive)
return;
else
UseSkill(SkillLooping, (ushort)Targ.PosX, (ushort)Targ.PosY, SkillLoopingTarget);

}
else if (SkillLoopingTarget < 7000 && SkillLoopingTarget >= 5000)
{
SingleNPC Targ = (SingleNPC)NPCs.AllNPCs[SkillLoopingTarget];
if (Targ == null)
return;
else
UseSkill(SkillLooping, (ushort)Targ.X, (ushort)Targ.Y, SkillLoopingTarget);

}
else
{
Character Targ = (Character)World.AllChars[SkillLoopingTarget];
if (Targ == null || !Targ.Alive)
return;
else
UseSkill(SkillLooping, Targ.LocX, Targ.LocY, SkillLoopingTarget);
}
}
else
{
UseSkill(SkillLooping, SkillLoopingX, SkillLoopingY, 0); //here <<---
}
}
else
{
SkillLooping = 0;
}
}
Ready = true;

}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}







and


if (!Other.NoPK(LocMap))
if (PKMode == 2 || PKMode == 0)
{

Character Target = (Character)World.AllChars[TargID];
if (Target.Alive) //here <--
if (!Target.Flying || SkillAttributes[0] != 12)
{
X = Target.LocX;
Y = Target.LocY;
if someone can help me
reborn666 is offline  
Old 10/27/2008, 21:21   #2
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Target is null.
Code:
[Color="Blue"]if [/color][Color="Black"]([b][i]Target != null[/i][/b] && Target.Alive)[/color]
Should fix it.
tao4229 is offline  
Old 10/27/2008, 21:48   #3
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,882
Quote:
Originally Posted by tao4229 View Post
Target is null.
Code:
[Color="Blue"]if [/color][Color="Black"]([b][i]Target != null[/i][/b] && Target.Alive)[/color]
Should fix it.
I'm not sure if C#'s pre-processor is smart enough to inline the null check to this, but it should be

if (Target != null)
{
if (Target.Active)
{

}
}

Or else when it evaluates the right hand side of the &&, if the left side is false (meaning it's null) you'll still get the error.
InfamousNoone is offline  
Thanks
1 User
Old 10/27/2008, 22:03   #4
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Didn't know that, thanks =o.
tao4229 is offline  
Old 10/28/2008, 15:36   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
Red face

Quote:
Originally Posted by InfamousNoone View Post
I'm not sure if C#'s pre-processor is smart enough to inline the null check to this, but it should be

if (Target != null)
{
if (Target.Active)
{

}
}

Or else when it evaluates the right hand side of the &&, if the left side is false (meaning it's null) you'll still get the error.
ths i'm working with this code
reborn666 is offline  
Reply


Similar Threads Similar Threads
201 erros in C# lol xD
07/26/2010 - CO2 Private Server - 6 Replies
So ive started the npc for my 3rd rebirth quest, i have this so far (i think its right) #region Jon the third rebirth NPC case 5467: { if (Control ==0) { GC.AddSend(Packets.NPCSay("Hello young one, would you like to attempt the third rebirth quest? You need to be atleast level 140.")); ...
Wierd Erros Help PLZ!!!
02/02/2008 - Silkroad Online - 1 Replies
hey guyz i've just downloaded silkroad Private server and some wierd erro showed up like right afther i pressed start could any one help me...? tnx :(



All times are GMT +2. The time now is 15:48.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.