npetrovski / l2js-client

JavaScript client for Lineage 2
MIT License
105 stars 34 forks source link

ValidatePosition #25

Open Hindi opened 3 years ago

Hindi commented 3 years ago

Hi,

Looking at how you handle movements,it seems that you do not handle the Z coordinate correctly when moving without attacking : when l2creatures move, you update the X and Y coordinates but not Z, so when ValidatePosition is sent, Z is incorrect. Am I right here or did I miss something? Is using geodata the only way to fix that?

Subsidiary question: Have you taken a look at protocol 140? I'm trying to figure out the last int sent by the client in ValidatePosition. It looks a bit random even during a single move (it comes after vehicleId).

npetrovski commented 3 years ago

Hi. If you referring L2Creatures -> setMovingTo() I am afraid you are right - I am using a 2D Vector for calculating the position taking into account only X and Y. I guess I can work on this issue very soon and use 3-dimensional Vector in order to calculate X,Y and Z

Thank you

Hindi commented 3 years ago

I don't really need it, but I'm wondering how things work out in places where the Z coordinates changes alot (ToI for example). Do you think averaging the Z value will be enough? Beacause using the geodata will be a pain to maintain.