Quake3World.com Forums
     Programming Discussion
        entityState ints are 8 bit?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: entityState ints are 8 bit?

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44132
PostPosted: 05-20-2011 11:41 AM           Profile   Send private message  E-mail  Edit post Reply with quote


I've been using various integers that are part of the entityState_s struct to pass data to the client from the server through events (tempEntity). It appears that all ints like eventParm and generic1 are truncated to 8 bits and if you put a value higher than 255 in them, they'll end up as 0 on the client's side.

Is this something I'm doing wrong or am I right in my assumption here. If I'm right about this, is there any way to send proper (32-bit) ints to the client?




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-20-2011 12:22 PM           Profile Send private message  E-mail  Edit post Reply with quote


It depends on the field, some are send with higher fidelity than others. Have a look at the playerStateFields[] array in qcommon/msg.c - you probably need to break up the int in two 16 bit words. Have you tried slotting your data into the stats array?

https://github.com/ariya/ioquake3/blob/ ... sg.c#L1130




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.