mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-17 18:00:25 +02:00
Match unit_definition_get_seat_active_hud_index
This commit is contained in:
1 parent
691da875d2
commit
17fdd80b8d
2 files changed
+22
No files matched your search
@@ -41,4 +41,25 @@ long unit_definition_get_active_hud_index(
|
||||
struct unit_hud_reference)->hud);
|
||||
}
|
||||
|
||||
long unit_definition_get_seat_active_hud_index(
|
||||
struct unit_definition const *definition,
|
||||
short seat_index,
|
||||
boolean multiplayer)
|
||||
{
|
||||
struct unit_seat *seat = TAG_BLOCK_GET_ELEMENT(
|
||||
&definition->unit.seats,
|
||||
seat_index,
|
||||
struct unit_seat);
|
||||
short hud_index = multiplayer != FALSE;
|
||||
hud_index = MIN(hud_index, seat->seat_huds.count - 1);
|
||||
|
||||
if (hud_index < 0)
|
||||
return NONE;
|
||||
|
||||
return verify_tag_reference(&TAG_BLOCK_GET_ELEMENT(
|
||||
&seat->seat_huds,
|
||||
hud_index,
|
||||
struct unit_hud_reference)->hud);
|
||||
}
|
||||
|
||||
/* ---------- private code */
|
||||
@@ -164,6 +164,7 @@ struct unit_definition
|
||||
/* ---------- prototypes/EXAMPLE.C */
|
||||
|
||||
long unit_definition_get_active_hud_index(struct unit_definition const *definition, boolean multiplayer);
|
||||
long unit_definition_get_seat_active_hud_index(struct unit_definition const *definition, short seat_index, boolean multiplayer);
|
||||
|
||||
/* ---------- globals */
|
||||
|
||||
|
||||
Reference in new issue
Block a user