JMB Networks
Wanderer
.
I removed the Console line to compile properly, let me check if this works
I removed the Console line to compile properly, let me check if this works
Container pack = this.Backpack;
if(pack != null)
{
Console.WriteLine("found backpack");
Item testItem = pack.FindItemByType(typeof(FlagItem));
if(testItem != null)
{
Console.WriteLine("player has FlagItem at this point OnBeforeDeath");
}
else
{
Console.WriteLine("player does NOT have FlagItem at this point OnBeforeDeath");
}
}
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Items
{
public class FlagItem : Item
{
[Constructable]
public FlagItem() : this( 1 )
{
}
[Constructable]
public FlagItem( int amount ) : base( 3699 )
{
Weight = 5.0;
Hue = 0x496;
Movable = false;
}
//////////////////////////////////////////////////////////////////////////////////////////
Container pack = this.Backpack;
if(pack != null)
{
Console.WriteLine("found backpack");
Item testItem = pack.FindItemByType(typeof(FlagItem));
if(testItem != null)
{
Console.WriteLine("player has FlagItem at this point OnBeforeDeath");
}
else
{
Console.WriteLine("player does NOT have FlagItem at this point OnBeforeDeath");
}
}
public FlagItem( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if ( Hue == 0 )
Hue = 0x8AC;
}
}
}