From 046afbe7a221d9c90775e6e2d980821103aaae70 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 25 Dec 2012 10:03:23 +0000 Subject: Corrected an issue where entity health was not transferred when sending a create entity network message. --- src/core/entity.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/entity.cc') diff --git a/src/core/entity.cc b/src/core/entity.cc index ff15e6e..4a603f1 100644 --- a/src/core/entity.cc +++ b/src/core/entity.cc @@ -1134,8 +1134,9 @@ void EntityControlable::set_thrust(float thrust) void EntityControlable::serialize_server_create(std::ostream & os) const { EntityDynamic::serialize_server_create(os); - os << roundf(entity_thrust*100.0f) << " " - << (entity_owner ? entity_owner->id() : 0) << " "; + os << roundf(entity_thrust*100.0f) << " "; + os << (entity_owner ? entity_owner->id() : 0) << " "; + os << roundf(health()) << " "; } void EntityControlable::receive_server_create(std::istream &is) @@ -1161,6 +1162,8 @@ void EntityControlable::receive_server_create(std::istream &is) con_warn << "could not find owner " << owner_id << " for entity " << id() << "\n"; } } + + is >> entity_health; } void EntityControlable::serialize_client_update(std::ostream & os) const -- cgit v1.2.3