use real time instead of frame time for position updates, make sure sign is extended to 32 bits

This commit is contained in:
Darren Ranalli 2007-08-09 03:49:34 +00:00
parent fee45da2c1
commit 701cfb9821

View File

@ -319,9 +319,12 @@ finish_send_update(DCPacker &packer) {
static const double delta = 0.0f;
#endif // HAVE_PYTHON
double local_time = ClockObject::get_global_clock()->get_frame_time();
double local_time = ClockObject::get_global_clock()->get_real_time();
short network_time = (short)(int)cfloor(((local_time - delta) * network_time_precision) + 0.5);
int network_time = (int)cfloor(((local_time - delta) * network_time_precision) + 0.5);
// Preserves the lower NetworkTimeBits of the networkTime value,
// and extends the sign bit all the way up.
network_time = ((network_time + 0x8000) & 0xFFFF) - 0x8000;
packer.pack_int(network_time);
packer.pop();