From 0b3a444048953dc0a6642ffc10062c196c79d56a Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 8 Aug 2008 00:36:44 +0000 Subject: fix major network message rounding bug --- src/core/entity.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/core/entity.cc') diff --git a/src/core/entity.cc b/src/core/entity.cc index a4b6ee5..7472908 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -172,13 +172,13 @@ void Entity::serialize_server_create(std::ostream & os) const os << entity_moduletypeid << " " << entity_flags << " " << (entity_zone ? entity_zone->id() : 0) << " " - << entity_location << " " + << std::setprecision(8) << entity_location << " " << entity_color << " " << entity_color_second << " " << entity_shape << " " << entity_radius << " " - << entity_axis.forward() << " " - << entity_axis.left() << " " + << std::setprecision(8) << entity_axis.forward() << " " + << std::setprecision(8) << entity_axis.left() << " " << "\"" << entity_label << "\" " << "\"" << entity_name << "\" " << "\"" << entity_modelname << "\" "; @@ -327,7 +327,8 @@ void EntityDynamic::receive_client_update(std::istream &is) void EntityDynamic::serialize_server_update(std::ostream & os) const { - os << entity_location << " " + os << std::setprecision(8) + << entity_location << " " << entity_axis.forward() << " " << entity_axis.left() << " " << roundf(entity_speed * 100.0f) << " " -- cgit v1.2.3