m_Player->GetRotation(): always returns 0.000000
#5
(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.
Reply
Thanks given by:


Messages In This Thread
RE: m_Player->GetRotation(): always returns 0.000000 - by rs2k - 11-04-2011, 03:23 AM



Users browsing this thread: 3 Guest(s)