Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix proximity additions for existing objects to handle the optional m…

…esh and physics fields properly.
  • Loading branch information...
commit 51b9af424f01c3ae640141eb4c124d5f4980c6b9 1 parent 17d7179
@ewencp ewencp authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 liboh/src/HostedObject.cpp
View
8 liboh/src/HostedObject.cpp
@@ -766,9 +766,13 @@ bool HostedObject::handleProximityMessage(const SpaceObjectReference& spaceobj,
else {
// Reset so that updates from this new "session" for this proxy
// get applied
-
proxy_obj->reset();
- processLocationUpdate(space, proxy_obj, 0, true, &loc, &orient, &bnds, &mesh, &phy);
+
+ // We need to handle optional values properly -- they
+ // shouldn't get overwritten.
+ String* mesh_ptr = (addition.has_mesh() ? &mesh : NULL);
+ String* phy_ptr = (addition.has_physics() ? &phy : NULL);
+ processLocationUpdate(space, proxy_obj, 0, true, &loc, &orient, &bnds, mesh_ptr, phy_ptr);
// Mark as valid again
proxy_obj->validate();
}
Please sign in to comment.
Something went wrong with that request. Please try again.