• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ tfs 1.5 nekiro 7.72 replace item from ground to equipment slots

Hbraveq

Active Member
Joined
Nov 11, 2012
Messages
167
Reaction score
39
Hello

I've got problem with "replacing items". ex. I can't equip magic sword from ground if I have other weapon, I need to put it into my bp firrstly. Any ideas?
 
Solution
player.cpp
ReturnValue Player::queryAdd

C++:
    //need an exchange with source? (destination item is swapped with currently moved item)
    const Item* inventoryItem = getInventoryItem(static_cast<slots_t>(index));
    if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->getID() != item->getID())) {
        //those lines below are comment to allow swap/equip items (in exchange to another) directly from ground or loot container.
        //const Cylinder* cylinder = item->getTopParent();
        //if (cylinder && (dynamic_cast<const DepotChest*>(cylinder) || dynamic_cast<const Player*>(cylinder))) {
        //    return RETURNVALUE_NEEDEXCHANGE;
        //}

        return RETURNVALUE_NEEDEXCHANGE;
    }
    return ret;
player.cpp
ReturnValue Player::queryAdd

C++:
    //need an exchange with source? (destination item is swapped with currently moved item)
    const Item* inventoryItem = getInventoryItem(static_cast<slots_t>(index));
    if (inventoryItem && (!inventoryItem->isStackable() || inventoryItem->getID() != item->getID())) {
        //those lines below are comment to allow swap/equip items (in exchange to another) directly from ground or loot container.
        //const Cylinder* cylinder = item->getTopParent();
        //if (cylinder && (dynamic_cast<const DepotChest*>(cylinder) || dynamic_cast<const Player*>(cylinder))) {
        //    return RETURNVALUE_NEEDEXCHANGE;
        //}

        return RETURNVALUE_NEEDEXCHANGE;
    }
    return ret;
 
Solution
Back
Top