Shadow-Sigma
Wanderer
"Cannot change return type when overriding the inherited member"
My scripts that seem to be related to the problem:
AppleTree.cs -
(This is the script I think the problem's in. This is a mod off of the SmallBedEast scripts, the highlighted part I haven't changed from the original script, don't know what to do with it.)
BaseLeavesDeed.cs -
Error Report:
My scripts that seem to be related to the problem:
AppleTree.cs -
(This is the script I think the problem's in. This is a mod off of the SmallBedEast scripts, the highlighted part I haven't changed from the original script, don't know what to do with it.)
Code:
using System;
using Server;
namespace Server.Items
{
public class AppleTree : BaseLeaves
{
public override BaseLeavesDeed Deed{ get{ return new AppleTreeDeed(); } }
[Constructable]
public AppleTree()
{
AddComponent( new AddonComponent( 0xd95 ), 0, 0, 0 );
AddComponent( new AddonComponent( 0xd96 ), 0, 0, 0 );
}
public AppleTree( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
public class AppleTreeDeed : BaseLeavesDeed
{
public override BaseLeaves Addon{ get{ return new AppleTreeDeed(); } }
[COLOR="Red"] public override int LabelNumber{ get{ return 1044322; } } [/COLOR]
[Constructable]
public AppleTreeDeed()
{
}
public AppleTreeDeed( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
BaseLeavesDeed.cs -
Code:
using System;
using System.Collections;
using Server;
using Server.Targeting;
namespace Server.Items
{
[Flipable( 0x14F0, 0x14EF )]
public abstract class BaseLeavesDeed : Item
{
public abstract BaseLeaves Addon{ get; }
public BaseLeavesDeed() : base( 0x14F0 )
{
Weight = 1.0;
if ( !Core.AOS )
LootType = LootType.Newbied;
}
public BaseLeavesDeed( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if ( Weight == 0.0 )
Weight = 1.0;
}
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
from.Target = new InternalTarget( this );
else
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
private class InternalTarget : Target
{
private BaseLeavesDeed m_Deed;
public InternalTarget( BaseLeavesDeed deed ) : base( -1, true, TargetFlags.None )
{
m_Deed = deed;
CheckLOS = false;
}
protected override void OnTarget( Mobile from, object targeted )
{
IPoint3D p = targeted as IPoint3D;
Map map = from.Map;
if ( p == null || map == null || m_Deed.Deleted )
return;
if ( m_Deed.IsChildOf( from.Backpack ) )
{
BaseAddon addon = m_Deed.Addon;
Server.Spells.SpellHelper.GetSurfaceTop( ref p );
ArrayList houses = null;
AddonFitResult res = addon.CouldFit( p, map, from, ref houses );
if ( res == AddonFitResult.Valid )
addon.MoveToWorld( new Point3D( p ), map );
else if ( res == AddonFitResult.Blocked )
from.SendLocalizedMessage( 500269 ); // You cannot build that there.
else if ( res == AddonFitResult.NotInHouse )
from.SendLocalizedMessage( 500274 ); // You can only place this in a house that you own!
else if ( res == AddonFitResult.DoorsNotClosed )
from.SendMessage( "You must close all house doors before placing this." );
else if ( res == AddonFitResult.DoorTooClose )
from.SendLocalizedMessage( 500271 ); // You cannot build near the door.
else if ( res == AddonFitResult.NoWall )
from.SendLocalizedMessage( 500268 ); // This object needs to be mounted on something.
if ( res == AddonFitResult.Valid )
{
m_Deed.Delete();
if ( houses != null )
{
foreach ( Server.Multis.BaseHouse h in houses )
h.Addons.Add( addon );
}
}
else
{
addon.Delete();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
}
}
}
Error Report:
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Custom\Test Folder\AppleTree\AppleTree.cs: CS0508: (line 38, c
olumn 30) 'Server.Items.AppleTreeDeed.Addon': cannot change return type when overriding inherited member 'Server.Items.BaseLeavesDeed.Addon'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.