Keep getting this error in the Claim.cs

Errors:
+ My Custom scripts[1]/Utilities/Claim System/Claim.cs:
cs1501: Line 249: No overload for method 'CheckLoot' takes '1' arguments

Here is the section and line of code in the Claim.cs throwing the error...

private static bool CorpseIsLootable( Mobile from, Corpse corpse, bool notify )
{
if ( null == corpse )
return false;

bool result = false;
string notification = "";

if ( corpse.Owner == from )
notification = "You may not claim your own corpses.";
else if ( corpse.Owner is PlayerMobile && !ClaimConfig.LootPlayers )
notification = "You may not loot player corpses.";
else
{
BaseCreature creature = corpse.Owner as BaseCreature;

if ( null != creature && creature.IsBonded )
notification = "You may not loot the corpses of bonded pets.";
else if ( null != creature && creature.Fame <= ClaimConfig.FreelyLootableFame )
result = true;
else
--------------> result = corpse.CheckLoot( from ) && !( corpse.IsCriminalAction( from ) );

}

if ( false == result && notify )
{
from.PlaySound( 1074 ); // no
from.SendMessage( notification );
}

return result;
}



So I looked in the Corpse.cs and found this...

public bool CheckLoot( Mobile from, Item item )
{
if ( !CanLoot( from, item ) )
{
if ( m_Owner == null || !m_Owner.Player )
from.SendLocalizedMessage( 1005035 ); // You did not earn the right to loot this creature!
else
from.SendLocalizedMessage( 1010049 ); // You may not loot this corpse.
return false;
}
else if ( IsCriminalAction( from ) )
{
if ( m_Owner == null || !m_Owner.Player )
from.SendLocalizedMessage( 1005036 ); // Looting this monster corpse will be a criminal act!
else
from.SendLocalizedMessage( 1005038 ); // Looting this corpse will be a criminal act!
}
return true;
}

Not sure how to fix this line of code...
 
Code:
 result = corpse.CheckLoot( from ) && !( corpse.IsCriminalAction( from ) );
change to:
Code:
 result = corpse.CheckLoot( from, null ) && !( corpse.IsCriminalAction( from ) );
[doublepost=1521533913][/doublepost]better yet, remove The item item argument from the method signature. I don't see it use anywhere else, consequently it makes no sense to send the data of item.

Change:
Code:
public bool CheckLoot( Mobile from, Item item )
to
Code:
public bool CheckLoot( Mobile from )

and:
Code:
public bool CanLoot(Mobile from, Item item)
to
Code:
public bool CanLoot(Mobile from)
 
Last edited:
Back