Skip to content

Commit 2beaa88

Browse files
authored
Fixes Team Colors not working with show-ship (#4436)
Updates the `show-ship` function to account for team colors. Also, cleans up the function a bit. Tested and works as expected. Fixes #4435
1 parent 9de4a49 commit 2beaa88

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

code/ship/ship.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7419,10 +7419,20 @@ void ship_render_show_ship_cockpit(object *objp)
74197419
model_render_params render_info;
74207420

74217421
render_info.set_object_number(OBJ_INDEX(objp));
7422-
render_info.set_replacement_textures(Ships[objp->instance].ship_replacement_textures);
7422+
7423+
// update any replacement and/or team color textures (wookieejedi), then render
7424+
ship* shipp = &Ships[objp->instance];
7425+
ship_info* sip = &Ship_info[Ships[objp->instance].ship_info_index];
7426+
7427+
render_info.set_replacement_textures(shipp->ship_replacement_textures);
7428+
7429+
if (sip->uses_team_colors) {
7430+
render_info.set_team_color(shipp->team_name, shipp->secondary_team_name, 0, 0);
7431+
}
7432+
74237433
render_info.set_detail_level_lock(0);
74247434

7425-
model_render_immediate(&render_info, Ship_info[Ships[objp->instance].ship_info_index].model_num, &objp->orient,
7435+
model_render_immediate(&render_info, sip->model_num, &objp->orient,
74267436
&objp->pos); // Render ship model with fixed detail level 0 so its not switching LOD when
74277437
// moving away from origin
74287438
Glowpoint_override = false;

0 commit comments

Comments
 (0)