Skip to content

Commit b56e64d

Browse files
Allow a Drone to be created from the location and direction of another Drone
1 parent 4c28000 commit b56e64d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/js/modules/drone/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ function Drone( x, y, z, dir, world ) {
398398
}
399399
populateFromLocation( playerPos );
400400
}
401+
} else if ( x instanceof Drone ) {
402+
this.x = x.x;
403+
this.y = x.y;
404+
this.z = x.z;
405+
this.dir = x.dir;
406+
this.world = x.world;
401407
} else {
402408
if ( arguments[0].x && arguments[0].y && arguments[0].z ) {
403409
populateFromLocation( arguments[ 0 ] );

0 commit comments

Comments
 (0)