Location isn't recalculated for moved entities

Bug #287414 reported by Erik Ogenvik
2
Affects Status Importance Assigned to Milestone
Cyphesis
Fix Committed
Undecided
Erik Ogenvik

Bug Description

When an entity is moved on the client the location isn't recalculated. As an example, if a pig is inside the sty but is moved by the client to somewhere else, it will still have the sty as it's location.

The code in Ember which places the entity is as follows:
void ConnectedAdapter::place(Eris::Entity* entity, Eris::Entity* target, const WFMath::Point<3>& pos, const WFMath::Quaternion& orient)
{
  Atlas::Objects::Entity::Anonymous what;
  what->setLoc(target->getId());
  what->setPosAsList(Atlas::Message::Element(pos.toAtlas()).asList());
  what->setAttr("orientation", orient.toAtlas());

  what->setId(entity->getId());

  Atlas::Objects::Operation::Move moveOp;
  moveOp->setFrom(mAvatar->getEntity()->getId());
  moveOp->setArgs1(what);

  if (mAvatar->getEntity()->getType()->isA(mConnection->getTypeService()->getTypeByName("creator"))) {
   moveOp->setTo(entity->getId());
  }

  mConnection->send(moveOp);
}

If "what->setLoc(...)" is omitted the server will reject the operation (which is expected since else it must have the location in order to know the space in which the position and orientation operates).

I'm guessing the fix would be to add an extra location check whenever something is moved.

Changed in cyphesis:
assignee: nobody → Erik Ogenvik (erik-ogenvik)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.