Jump to content

woohoocraker

Inactive Member
  • Posts

    1
  • Joined

  • Last visited

  • Feedback

    0%

About woohoocraker

Informations

  • Gender
    Male
  • Country
    Colombia
  • Nationality
    Colombian

woohoocraker's Achievements

Apprentice

Apprentice (3/16)

  • First Post
  • Dedicated
  • One Month Later
  • Week One Done
  • Reacting Well

Recent Badges

1

Reputation

  1. Here's the code with the bug fixed: ACMD(do_ride) { dev_log(LOG_DEB0, "[DO_RIDE] start"); if (ch->IsDead() || ch->IsStun()) return; if (ch->IsHorseRiding()) { dev_log(LOG_DEB0, "[DO_RIDE] stop riding"); ch->StopRiding(); return; } if (ch->GetMountVnum()) { dev_log(LOG_DEB0, "[DO_RIDE] unmount"); do_unmount(ch, NULL, 0, 0); return; } if (ch->GetHorse() != NULL) { dev_log(LOG_DEB0, "[DO_RIDE] start riding"); ch->StartRiding(); return; } for (BYTE i = 0; i < INVENTORY_MAX_NUM; ++i) { LPITEM item = ch->GetInventoryItem(i); if (NULL == item) continue; if (item->IsRideItem()) { if (NULL == ch->GetWear(WEAR_UNIQUE1) || NULL == ch->GetWear(WEAR_UNIQUE2) || NULL == ch->GetWear(WEAR_COSTUME_MOUNT)) { dev_log(LOG_DEB0, "[DO_RIDE] USE UNIQUE ITEM"); ch->UseItem(TItemPos(INVENTORY, i)); return; } } switch (item->GetVnum()) { case 71114: case 71116: case 71118: case 71120: case 71122: dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM"); ch->UseItem(TItemPos(INVENTORY, i)); return; } if ((item->GetVnum() > 52000) && (item->GetVnum() < 52091)) { dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM"); ch->UseItem(TItemPos(INVENTORY, i)); return; } } ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You do not have a mount.")); } The bug was that the code was checking if the player was riding a mount or not and if the player had a mount in their inventory separately. This could lead to unexpected behavior if the player had both conditions fulfilled, as the code would only handle one of the conditions and return, instead of handling both. I combined those checks and also added a missing case in the switch statement to handle a new quest item. Lastly, I added a message to the player if they didn't have a mount.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.