Merged duplicate code

The case for object1 being a group or emitter was the same, so I consolidated the test case to line 582.