Google-Code-Fork / tibiaapi

Automatically exported from code.google.com/p/tibiaapi
MIT License
0 stars 0 forks source link

Map.ReplaceTrees #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
So I decided to test our current ReplaceTrees code. For me, at least, it
does replace the tree's base sprite (bottom-right) with the sprite of a
small fir tree, but it also replaced the top-right sprite with a counter
top sprite. Here's my take on how to fix this, if you guys agree.

Each tree returns 4 sprites, the base (bottom-right) being the first
returned sprite. Small fir trees return 1 sprite. So all we need to do is
read the sprite ID of a small fir tree, write the ID to each tree's first
sprite, then set the last 3 to 0 and I'm pretty sure the client handles 0
as being nothing.

Original issue reported on code.google.com by joebingham07@gmail.com on 11 Mar 2009 at 5:59

GoogleCodeExporter commented 9 years ago
Good idea, I didn't test how any of the changes would affect the existing code. 
Just
test your idea and then check it in for further review (you can replace the 
existing
Map.ReplaceTrees code).

Original comment by ian320 on 11 Mar 2009 at 9:22

GoogleCodeExporter commented 9 years ago
I'm not sure why yours does that, but I just tested it and it works as 
expected; no
countertop. Any way you can help me reproduce the error?

Original comment by ian320 on 13 Mar 2009 at 9:18

GoogleCodeExporter commented 9 years ago

Original comment by joebingham07@gmail.com on 24 Apr 2009 at 5:36

GoogleCodeExporter commented 9 years ago
I reopened this Issue because I was testing ReplaceTrees again and this is my 
before
and after shots:

Before - http://img21.imageshack.us/img21/7244/rtbefore.png
After - http://img21.imageshack.us/img21/9359/rtafter.png

Any clue why this happens to me?

Original comment by joebingham07@gmail.com on 5 May 2009 at 7:28

GoogleCodeExporter commented 9 years ago
Sprites are actually 2 bytes long and some of those tree had more than 1 
sprite...so
i think that by writing 3 bytes at the offset of the first sprite you were 
actually
modifying the following ones.
Anyway it should be fixed by now.

Original comment by geancarl...@gmail.com on 4 Jul 2009 at 2:54