@@ -1424,21 +1424,29 @@ int object_check_collision(object *objp, vec3d *p0, vec3d *p1, vec3d *hitpos) {
14241424 return 0 ;
14251425 }
14261426
1427- // PROP HERE?
1427+ if (objp->type == OBJ_PROP ) {
1428+ if (!Props[objp->instance ].has_value ())
1429+ return 0 ;
1430+ }
14281431
14291432 if (objp->flags [Object::Object_Flags::Hidden, Object::Object_Flags::Locked_from_editing])
14301433 return 0 ;
14311434
1432- if ((Show_ship_models || Show_outlines) && (objp->type == OBJ_SHIP )) {
1433- mc.model_num = Ship_info[Ships[objp->instance ].ship_info_index ].model_num ; // Fill in the model to check
1435+ mc.model_instance_num = -1 ;
1436+
1437+ if ((Show_ship_models || Show_outlines) && (objp->type == OBJ_SHIP || objp->type == OBJ_START )) {
1438+ auto & shp = Ships[objp->instance ];
1439+ mc.model_num = Ship_info[shp.ship_info_index ].model_num ; // Fill in the model to check
1440+ mc.model_instance_num = shp.model_instance_num ;
14341441
1435- } else if ((Show_ship_models || Show_outlines) && (objp->type == OBJ_START )) {
1436- mc.model_num = Ship_info[Ships[objp->instance ].ship_info_index ].model_num ; // Fill in the model to check
1442+ } else if ((Show_ship_models || Show_outlines) && (objp->type == OBJ_PROP )) {
1443+ auto & prp = Props[objp->instance ].value ();
1444+ mc.model_num = Prop_info[prp.prop_info_index ].model_num ; // Fill in the model to check
1445+ mc.model_instance_num = prp.model_instance_num ;
14371446
14381447 } else
14391448 return fvi_ray_sphere (hitpos, p0, p1, &objp->pos , (objp->radius > 0 .1f ) ? objp->radius : LOLLIPOP_SIZE );
14401449
1441- mc.model_instance_num = -1 ;
14421450 mc.orient = &objp->orient ; // The object's orient
14431451 mc.pos = &objp->pos ; // The object's position
14441452 mc.p0 = p0; // Point 1 of ray to check
0 commit comments