tonnie1391 wrote:Hi everyone,
It's lucky to make this. When you move, pickup or equip item the client wont crash anymore ^_^
Replace
ADDBYTE to
ADDWORD at
CPlayer::UpdateInventory in
playerfunctions.cpp - void CPlayer::UpdateInventory( unsigned int slot1, unsigned int slot2, bool save)
- {
- if(slot1 == 0xffff && slot2==0xffff) return;
- BEGINPACKET(pak, 0x718);
- if(slot1 != 0xffff && slot2 != 0xffff) { ADDBYTE( pak, 0x02 );} else {ADDBYTE( pak, 0x01 );}
- if(slot1 != 0xffff)
- {
- ADDBYTE( pak, slot1);
- ADDDWORD ( pak, GServer->BuildItemHead( items[slot1] ) );
- ADDDWORD ( pak, GServer->BuildItemData( items[slot1] ) );
- ADDDWORD( pak, 0x00000000 );
- ADDWORD ( pak, 0x0000 );
- }
- if(slot2 != 0xffff)
- {
- ADDBYTE ( pak, slot2);
- ADDDWORD ( pak, GServer->BuildItemHead( items[slot2] ) );
- ADDDWORD ( pak, GServer->BuildItemData( items[slot2] ) );
- ADDDWORD( pak, 0x00000000 );
- ADDWORD ( pak, 0x0000 );
- }
- client->SendPacket( &pak );
- if(!save)
- return;
- if(slot1!=0xffff)
- SaveSlot41(slot1);
- if(slot2!=0xffff)
- SaveSlot41(slot2);
- return;
- }
Hope this helpful to anyone ^_^
Sorry if I'm wrong!!!
This would entirely depend on the client version that you are using.
DR3 was optimized to work with client V335
If you use another client then the packet structures will very likely be different in some small cases like this.
This was around the time that NARose started to change packet structures with every patch.
I have to say though, the tests that are being done on the slot value (i.e.
if(slot1 != 0xffff) would indicate that slot is a WORD rather than a byte so it's possible this could be a bug that was missed completely before
In DR4 it is certainly a WORD rather than a BYTE