mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-17 17:00:35 +02:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
867855d388 | ||
|
|
9e7fd75f57 | ||
|
|
aedf5ff9bc | ||
|
|
fe160e9dbe | ||
|
|
12c97ffa85 |
No files matched your search
+1103
-10
File diff suppressed because it is too large.
Load diff
@@ -1670,3 +1670,40 @@ boolean game_engine_race_read_network_state(
|
||||
csmemcpy(race_events.best_laps, state.best_laps, sizeof(race_events.best_laps));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
boolean game_engine_race_next_flag(
|
||||
long player_index,
|
||||
real_point3d const *from,
|
||||
real_point3d *position)
|
||||
{
|
||||
struct scenario *scenario = global_scenario_get();
|
||||
real best_distance = REAL_MAX;
|
||||
boolean found = FALSE;
|
||||
long itr;
|
||||
|
||||
if (!scenario || DATUM_INDEX_TO_ABSOLUTE_INDEX(player_index) >= MULTIPLAYER_MAXIMUM_PLAYERS)
|
||||
return FALSE;
|
||||
for (itr = 0; itr < scenario->netgame_flags.count; itr++)
|
||||
{
|
||||
struct scenario_netgame_flag *flag = TAG_BLOCK_GET_ELEMENT(
|
||||
&scenario->netgame_flags,
|
||||
itr,
|
||||
struct scenario_netgame_flag);
|
||||
real distance;
|
||||
|
||||
if (flag->type != _netgame_flag_race_track ||
|
||||
!TEST_FLAG(race_globals.lap_completed_value, flag->team_index) ||
|
||||
!can_touch_team(player_index, flag->team_index))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
distance = distance3d(from, &flag->position);
|
||||
if (distance < best_distance)
|
||||
{
|
||||
best_distance = distance;
|
||||
*position = flag->position;
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
@@ -18,6 +18,13 @@ struct race_globals;
|
||||
|
||||
void race_flags_make_unique(
|
||||
void);
|
||||
/* port: the race flag a player is to touch next, the one of those it may
|
||||
touch nearest the point (the VR port's bots, port/linux/game/bots.c);
|
||||
FALSE: none */
|
||||
boolean game_engine_race_next_flag(
|
||||
long player_index,
|
||||
real_point3d const *from,
|
||||
real_point3d *position);
|
||||
|
||||
/* ---------- globals */
|
||||
|
||||
|
||||
@@ -853,6 +853,27 @@ done:
|
||||
return !no_vehicles_moving;
|
||||
}
|
||||
|
||||
short vehicle_bot_drive_kind(
|
||||
long vehicle_index)
|
||||
{
|
||||
struct vehicle_datum *vehicle = vehicle_datum_get(vehicle_index);
|
||||
struct vehicle_definition *definition = vehicle_specific_definition_get(
|
||||
vehicle->definition_index);
|
||||
|
||||
switch (definition->vehicle_type)
|
||||
{
|
||||
case _vehicle_type_human_jeep:
|
||||
case _vehicle_type_alien_scout:
|
||||
return _vehicle_bot_drive_facing;
|
||||
case _vehicle_type_human_tank:
|
||||
return _vehicle_bot_drive_relative;
|
||||
case _vehicle_type_turret:
|
||||
return _vehicle_bot_drive_turret;
|
||||
default:
|
||||
return _vehicle_bot_drive_none;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HALO_ANDROID
|
||||
boolean vehicle_vr_steered_by_facing(
|
||||
long vehicle_index)
|
||||
|
||||
@@ -81,6 +81,22 @@ void vehicle_render_debug(
|
||||
|
||||
/* ---------- public code */
|
||||
|
||||
/* port: how the VR port's bots (port/linux/game/bots.c) drive a vehicle:
|
||||
turned to where its driver faces (a jeep, a scout), moved where he pushes
|
||||
from where he faces (a tank), manned where it stands (a turret), or not
|
||||
at all (the rest) */
|
||||
enum
|
||||
{
|
||||
_vehicle_bot_drive_none = 0,
|
||||
_vehicle_bot_drive_facing,
|
||||
_vehicle_bot_drive_relative,
|
||||
_vehicle_bot_drive_turret,
|
||||
};
|
||||
short vehicle_bot_drive_kind(
|
||||
long vehicle_index);
|
||||
boolean vehicle_is_flipped(
|
||||
long vehicle_index);
|
||||
|
||||
#ifdef HALO_ANDROID
|
||||
/* VR: whether the vehicle's driver steers it by where he faces (the jeep,
|
||||
boat, plane, scout and fighter: the right stick steers them), as opposed to
|
||||
|
||||
Reference in new issue
Block a user