Sphereserver / Source

http://spherecommunity.net
Apache License 2.0
108 stars 58 forks source link

tryig to compile old sphere #257

Closed GitMadKing closed 4 years ago

GitMadKing commented 4 years ago

CCharNPCAct.cpp https://github.com/Sphereserver/Source/commit/da1ea405879d41041988a5bee971b58d6973757a

bool CChar::NPC_LootContainer( CItemContainer * pContainer )
{
    ADDTOCALLSTACK("CChar::NPC_LootContainer");
    // Go through the pack and see if there is anything I want there...
    CItem * pNext;
    CItem * pLoot = pContainer->GetContentHead();
    for ( ; pLoot != NULL; pLoot = pNext )
    {
        pNext = pLoot->GetNext();
        // Have I checked this one already?
        if ( Memory_FindObj( pLoot ))
            continue;

        if ( pLoot->IsContainer())
        {
            // Loot it as well
            if ( ! NPC_LootContainer( dynamic_cast <CItemContainer *> (pLoot)))
            {
                // Not finished with it
                return false;
            }
        }

        if ( ! NPC_WantThisItem( pLoot ))
            continue;

        // How much can I carry
        if ( CanCarry( pLoot ))
        {
            UpdateAnimate( ANIM_BOW );
            ItemEquip( pLoot );
        }
        else
        {
            // Can't carry the whole stack...how much can I carry?
            NPC_LootMemory( pLoot );
        }

        // I can only pick up one thing at a time, so come back here on my next tick
        SetTimeout( 1 );    // Don't go through things so fast.
        return false;
    }

    // I've gone through everything here...remember that we've looted this container
    NPC_LootMemory( pContainer );
    return true;
}

inline void CChar::NPC_Act_Looting_CantGetItem( CItem * pItem )
{
    ADDTOCALLSTACK("CChar::NPC_Act_Looting_CantGetItem");
    NPC_LootMemory( pItem );
    Skill_Start( SKILL_NONE );
}

image ANY HIT HOW TO PASS OVER? :)

coruja747 commented 4 years ago

The source code of 56c build from 26/jul/2015 seems to be messed, try using the last 56c build from 10/apr/2016 https://github.com/Sphereserver/Source/tree/56c-20160410

But note that these old builds are just for testing purposes, it's highly not recommended use on a live server because old builds doesn't have a lot of security fixes which are already fixed on latest 56d build. So using outdated builds will make your server highly vulnerable to many critical exploits

GitMadKing commented 4 years ago

thanks