dschu012 / d2s

88 stars 28 forks source link

Undefined error in `char.header.right_swap_skill = constants.skills[reader.ReadUInt32()].s` #40

Closed ktunkiewicz closed 2 years ago

ktunkiewicz commented 2 years ago

default_header.js:26

char.header.right_swap_skill = constants.skills[reader.ReadUInt32()].s; //0x0084

throws undefined because reader.ReadUInt32() returns 262198.

Save file attached. Bone.d2s.zip

Fixed temporarily by adding a ternary operator that checks for undefined first, not sure if that's correct way of dealing with this but it seams to read all other stuff fine. I'm not even able to verify this because I don't have D2R, I'm writing a script for my friend.

ktunkiewicz commented 2 years ago

Ah, I'm sorry, that was for 2.0.4 and you made quite lot of changes recently, including using ?.s in the above.