• 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!

Compiling BUG CLONE OTX

------------------SOLUTION------------------

Remove this code in player.cpp:

Code:
  if(index == SLOT_LEFT || index == SLOT_RIGHT)
   {
     if(ret == RET_NOERROR && item->getWeaponType()!= WEAPON_NONE)
       self->setLastAttack(OTSYS_TIME());

     Item* tmpItem = inventory[(slots_t)index];
     if(ret == RET_BOTHHANDSNEEDTOBEFREE && g_game.internalAddItem(
       NULL,self, tmpItem, INDEX_WHEREEVER)== RET_NOERROR)
     {
       self->sendRemoveInventoryItem((slots_t)index, tmpItem);
       self->onRemoveInventoryItem((slots_t)index, tmpItem);

       self->inventory[(slots_t)index]= NULL;
       self->updateWeapon();
       self->inventoryWeight -= tmpItem->getWeight();
       self->sendStats();
     }
   }
by fireelement
 
------------------SOLUTION------------------

Remove this code in player.cpp:

Code:
  if(index == SLOT_LEFT || index == SLOT_RIGHT)
   {
     if(ret == RET_NOERROR && item->getWeaponType()!= WEAPON_NONE)
       self->setLastAttack(OTSYS_TIME());

     Item* tmpItem = inventory[(slots_t)index];
     if(ret == RET_BOTHHANDSNEEDTOBEFREE && g_game.internalAddItem(
       NULL,self, tmpItem, INDEX_WHEREEVER)== RET_NOERROR)
     {
       self->sendRemoveInventoryItem((slots_t)index, tmpItem);
       self->onRemoveInventoryItem((slots_t)index, tmpItem);

       self->inventory[(slots_t)index]= NULL;
       self->updateWeapon();
       self->inventoryWeight -= tmpItem->getWeight();
       self->sendStats();
     }
   }
by fireelement

if you you remove the code that the only thing you will cause random will crash with the function "onRemoveInventoryItem"

the fix is this more simple use this i rewrite this code:

First
https://github.com/mattyx14/otxserver/commit/f784afb348a273cf66385075fe96d9b1d825a76d

Second
https://github.com/mattyx14/otxserver/commit/812c2375d5e2ddbd45bae0c20ba8142458583a27

AND THIS ARE THE SOLUTION
 
Back
Top