Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-08 00:36:44 +0000
committerStijn Buys <ingar@osirion.org>2008-08-08 00:36:44 +0000
commit0b3a444048953dc0a6642ffc10062c196c79d56a (patch)
tree1b4fa0031547732d0e478f3b8ff4ce9f89eb857c /src/core/entity.cc
parenta743791e624590e0b41229f28f940db5272b60ba (diff)
fix major network message rounding bug
Diffstat (limited to 'src/core/entity.cc')
-rw-r--r--src/core/entity.cc9
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) << " "