|
You last visited: Today at 01:42
Advertisement
[help] all my erros
Discussion on [help] all my erros within the CO2 Private Server forum part of the Conquer Online 2 category.
10/27/2008, 15:59
|
#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
|
|
|
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.
|
|
|
10/27/2008, 21:48
|
#3
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
|
Quote:
Originally Posted by tao4229
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.
|
|
|
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.
|
|
|
10/28/2008, 15:36
|
#5
|
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
|
Quote:
Originally Posted by InfamousNoone
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
|
|
|
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 +1. The time now is 01:43.
|
|