Page 1 of 1

NPC shopkeeper inventories are added to their weight

Posted: Fri Jan 29, 2010 9:45 pm
by Xuri
UOX3 version: 0.98-4.0d

The shopkeeper inventories (layers 0x1a, 0x1b and 0x1c) are added to shopkeeper NPC weight during weight-calculation. This causes, possibly amongst other things, NPCs that can train skills to be unable to accept money because they can't hold any more weight.

Posted: Fri Jan 29, 2010 10:49 pm
by Xuri
Fixed on CVS by adding the highlighted code below:

Code: Select all

bool CWeight::IsWeightedContainer( CItem *toCheck )
{
	switch( toCheck->GetLayer() )
	{
	case IL_NONE:		// Trade Window
	case IL_HAIR:		// hair
	case IL_FACIALHAIR:	// beard
	case IL_MOUNT:		// steed
	case IL_BANKBOX:	// bank box
	[color=red]case IL_BUYCONTAINER: //Contains items that NPC is interested in buying from 
	case IL_BOUGHTCONTAINER: //Contains items shopkeepers have bought from players
	case IL_SELLCONTAINER:  //Contains items shopkeepers sell to players[/color]
		return false;	// no weight for any of these
	default:
		break;
	}
	return true;
}