Move the object to in front of the viewer (where a new object would be placed)
| 551 | |
| 552 | // Move the object to in front of the viewer (where a new object would be placed) |
| 553 | void HObjectMoveToViewer(object *objp) { |
| 554 | int objnum = OBJNUM(objp); |
| 555 | vector pos; |
| 556 | |
| 557 | // First move player to viewer's position |
| 558 | ObjSetPos(objp, &Viewer_object->pos, Viewer_object->roomnum, NULL, false); |
| 559 | |
| 560 | // Second try to move the player a little in front of the viewer |
| 561 | pos = Viewer_object->pos + Viewer_object->orient.fvec * OBJECT_PLACE_DIST; |
| 562 | MoveObject(objp, &pos); |
| 563 | |
| 564 | World_changed = 1; |
| 565 | } |
| 566 | |
| 567 | #define MOVE_EPSILON 0.1 |
| 568 |
no test coverage detected