Author Topic: Skill Bug (get training in sword without a sword)  (Read 452 times)

ronxena

  • Hydlaa Resident
  • *
  • Posts: 88
    • View Profile
Skill Bug (get training in sword without a sword)
« on: February 20, 2005, 02:10:03 pm »
I strangly had the problem on laaanx server that I got training in sword skill, even if I never used a sword (but I had spent max. progression points for theoretical knowledge in swords). I expected to get training in melee, but since I am also mining a lot I keep the pick in my left hand and nothing in my right hand...

I played around on localhost and hunt the bug down, finding the following:

psItem *psCharacter::GetEffectiveWeaponInSlot(int slot)
{
    // Slot out of range
    if (slot<0 || slot>=PSCHARACTER_SLOT_COUNT)
        return NULL;

    // if there is an item in the slot, return it
    if (inventory.equipment[slot].item!=NULL)
        return inventory.equipment[slot].item;

    // right hand and left hand can attack also if no weapon is there
    // the default_if_empty is the fist weapon
    if (inventory.equipment[slot].EquipmentFlags & PSCHARACTER_EQUIPMENTFLAG_ATTACKIFEMPTY)
        return inventory.equipment[slot].default_if_empty;

    return NULL;
}

Oh wheee... I have a PICK in my left hand and it seems it simply returns the PICK as a sword and therefore I get training in sword. Strange stuff.
Ehh. Is a PICK a sword :-) If so I am wrong, but I assume a PICK is either more an axe than an sword or better a PICK is a tool.

But how can you determine if an item in your hand-inventory-slot is a weapon or simply a tool...?


Edit: I forgot to say: weapon stats for PICK in localhost-DB are -1,-1,-1 ... so even it if finds a pick it should not train skills.
« Last Edit: February 20, 2005, 02:22:13 pm by ronxena »