diff options
author | Stijn Buys <ingar@osirion.org> | 2008-08-08 00:36:44 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-08-08 00:36:44 +0000 |
commit | 0b3a444048953dc0a6642ffc10062c196c79d56a (patch) | |
tree | 1b4fa0031547732d0e478f3b8ff4ce9f89eb857c /src/core | |
parent | a743791e624590e0b41229f28f940db5272b60ba (diff) |
fix major network message rounding bug
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/entity.cc | 9 |
1 files changed, 5 insertions, 4 deletions
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) << " " |