Exemplo n.º 1
0
bool AttributeMap::SendAttributeChanges( PyTuple* attrChange )
{
    if (attrChange == NULL)
    {
        sLog.Error("AttributeMap", "unable to send NULL packet");
        return false;
    }

    // Oh hell, this character finding needs to be optimized ( redesigned so its not needed.. ).
    if( (mItem.ownerID() == 1) || (IsStation(mItem.itemID())) )
    {
        // This item is owned by the EVE System either directly, as in the case of a character object,
        // or indirectly, as in the case of a Station, which is owned by the corporation that runs it.
        // So, we don't need to queue up Destiny events in these cases.
        return true;
    }
    else
    {
        Client *client = sEntityList.FindCharacter(mItem.ownerID());
        //Client *client = this->mItem.GetItemFactory()->GetUsingClient();

        if (client == NULL)
        {
            //sLog.Error("AttributeMap::SendAttributeChanges()", "unable to find client:%u", mItem.ownerID());
            //return false;
            return true;
        }
        else
        {
            if( client->Destiny() == NULL )
            {
                //sLog.Warning( "AttributeMap::SendAttributeChanges()", "client->Destiny() returned NULL" );
                //return false;
            }
            else
                client->QueueDestinyEvent(&attrChange);

            return true;
        }
    }
}