Log in

View Full Version : Caught a few bugs in the current CVS


Wolfman
05-02-2003, 02:29 AM
client.cpp - bool Client::MoveItem(int16 to_slot, int16 from_slot, uint8 quantity):

~line 7557:
if (to_slot >= 1 && to_slot <= 21 && !database.GetItem(GetItemAt(to_slot))->IsEquipable(GetRace(), GetClass()) )

should be
if (to_slot >= 1 && to_slot <= 21 && !database.GetItem(GetItemAt(from_slot))->IsEquipable(GetRace(), GetClass()) )

GetItemAt(to_slot) evaluates to null and causes an unhandled exception because there isnt currently anything in the to_slot.


attack.cpp - void NPC::Damage(Mob* other, sint32 damage, int16 spell_id, int8 attack_skill, bool avoidable, sint8 buffslot, bool iBuffTic):

~line 1116:

parse->Event(EVENT_ATTACK, this->GetNPCTypeID(), 0, this, other->CastToClient());

should be:
parse->Event(EVENT_ATTACK, this->GetNPCTypeID(), 0, this, other->CastToMob());

Not sure how the CastToClient() got in there but it causes a crash when pets try to attack. Should be CastToMob().


client.cpp - bool Client::PutItemInInventory(int16 slotid, const Item_Struct* item, int8 charges, bool update):

Not really a bug, just something that disables a feature.

~line 6164:

if (update) {
more code
}

update never gets changed to true anywhere in the code so it doesn't allow players to loot corpses properly. Left clicking on the item while in a corpse deletes it but right clicking still works. Not sure if this is just due to something that's half implemented or not but perhaps it could be commented out for the time being (the if(update) part).

Trumpcard
05-02-2003, 02:52 AM
awesome! thanks for the bugfixes