I'm playing around with getting redstone going and while adding the redstone repeater I noticed that m_Player->GetRotation() always returns 0.000000
I started tracing the problem back and can see that when the PLAYERLOOK and PLAYERMOVELOOK packets are sent, m_Rotation is always 0. I don't know if the client is always sending a 0 or something's wrong with how the program's reading the packets.
right now it's not possible to place redstone repeaters or stairs in the direction you face.
Let me guess, you were running the game under Linux? I've encountered this before, this is a really weird bug. Minecraft seems to always send 0 for player rotation when running under Linux.
(11-04-2011, 12:03 AM)FakeTruth Wrote: [ -> ]Let me guess, you were running the game under Linux? I've encountered this before, this is a really weird bug. Minecraft seems to always send 0 for player rotation when running under Linux.
Yup, 64 bit linux.
So it has nothing to do with MCServer I think
(11-04-2011, 02:26 AM)FakeTruth Wrote: [ -> ]So it has nothing to do with MCServer I think
I found a "fix" for it, but I don't understand it.
adding this to Endianness.h allowed it to read the packet correctly:
(void)printf("",(unsigned long)buf);
Code:
inline float NetworkToHostFloat4( void* a_Value )
{
u_long buf = *(u_long*)a_Value;
buf = ntohl( (unsigned long)buf );
(void)printf("",(unsigned long)buf);
return *(float*)reinterpret_cast<float *>(&buf);
}
Any ideas? It works, but I don't like not knowing why.
Interesting, I have no clue why that would fix it
I changed it again, please try if it works now.
I think it screws up because of optimizations, but this should prevent that from happening.
Downloaded and recompiled. Seems to be working just fine. Redstone repeaters and stairs are going the right direction.
