Skip to content

Commit

Permalink
Added ai_vehicles functions comments
Browse files Browse the repository at this point in the history
  • Loading branch information
twist84 committed Dec 7, 2024
1 parent b05b905 commit fbf73db
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
2 changes: 1 addition & 1 deletion game/source/ai/ai_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ void ai_debug_render_vehicle_reservations()
for (short i = 0; i < 2; i++)
{
real_argb_color const* color = global_real_argb_white;
long actor_index = ai_vehicle_get_reservation(source.vehicle_index, source.seat_index, i == 0 ? 1 : 4);
long actor_index = ai_vehicle_get_reservation(source.vehicle_index, source.seat_index, i == 0 ? _campaign_team_player : _campaign_team_flood);
seat_position.z += 0.1f;

if (actor_index == NONE)
Expand Down
56 changes: 53 additions & 3 deletions game/source/ai/ai_vehicles.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,59 @@
#include "ai/ai_vehicles.hpp"

#include "cseries/cseries.hpp"
//.text:014416B0 ; void __cdecl ai_vehicle_enter2(long, long)
//.text:014416D0 ; void __cdecl ai_vehicle_enter(long, long, long)
//.text:014416F0 ; void __cdecl ai_vehicle_enter_immediate2(long, long)
//.text:01441710 ; void __cdecl ai_vehicle_enter_immediate(long, long, long)
//.text:01441730 ; void __cdecl ai_vehicle_enter_internal(long, long, long, bool)
//.text:01441800 ; void __cdecl ai_vehicle_flip(long)
//.text:01441840 ; long __cdecl ai_vehicle_get(long)
//.text:014418C0 ; long __cdecl ai_vehicle_get_from_spawn_point(long)
//.text:014418F0 ; long __cdecl ai_vehicle_get_from_squad(long, short)
//.text:01441920 ; long __cdecl ai_vehicle_get_from_starting_location(long)
//.text:014419B0 ; bool __cdecl ai_vehicle_overturned(long)
//.text:014419D0 ; bool __cdecl ai_vehicle_reserve(long, bool)
//.text:01441A90 ; bool __cdecl ai_vehicle_reserve_seat(long, long, bool)
//.text:01452740 ; void __cdecl actor_attach_to_seat(long, long, short, real, bool)
//.text:01452840 ; void __cdecl actor_attach_to_vehicle(long, long, bool)
//.text:01452980 ; bool __cdecl actor_handle_seat_attach(long, long, short)
//.text:01452CB0 ; void __cdecl actor_handle_seat_entry(long, long, short)
//.text:01452D70 ; void __cdecl actor_handle_seat_exit(long, long, short, bool, e_motor_program*)
//.text:01452E60 ; void __cdecl actor_handle_seat_exit_start(long, long, short)
//.text:01452EB0 ; void __cdecl actor_handle_vehicle_detach(long, long, long, short)
//.text:01453010 ; void __cdecl actor_throttle_vehicle_speed(long)
//.text:01453300 ; long __cdecl ai_get_root_vehicle(long)
//.text:01453340 ; void __cdecl ai_handle_driver_change(long)
//.text:014534E0 ; void __cdecl ai_player_handle_seat_entry(long, long, short)
//.text:014536B0 ; void __cdecl ai_player_handle_seat_exit(long, long, short)
//.text:014537C0 ; void __cdecl ai_player_handle_seat_exit_start(long)
//.text:01453810 ; real __cdecl ai_unit_get_seat_preference(long, short, bool, bool, bool)
//.text:01453960 ; real __cdecl ai_unit_get_seat_score(long, long, short, real, bool)
//.text:01453B20 ; bool __cdecl ai_unit_seat_allowed(long, long, short, e_game_team)
//.text:01453BD0 ; bool __cdecl ai_unit_seat_disallowed(long, long, short, e_game_team)
//.text:01453E50 ; bool __cdecl ai_unit_seats_available(long)
//.text:01453ED0 ; bool __cdecl ai_vehicle_cancel_reservation(long)
//.text:01453F70 ; bool __cdecl ai_vehicle_check_seat(long, seat_entry_info*)
//.text:01453FE0 ; bool __cdecl ai_vehicle_choose_seat(long)
//.text:01454150 ; bool __cdecl ai_vehicle_desirable(long, long, bool, bool)
//.text:01454270 ; bool __cdecl ai_vehicle_enterable(long, long, real, bool)
//.text:01454370 ; bool __cdecl ai_vehicle_evaluate_seat(long, long, short, bool, seat_entry_info*)
//.text:01454800 ; bool __cdecl ai_vehicle_find_seat(long, long, unit_seat_source const*, short, seat_entry_info*)
//.text:01454A10 ; long __cdecl ai_vehicle_get_driver(long, e_game_team)
//.text:01454A80 ; short __cdecl ai_vehicle_get_num_flip_actors(long)
//.text:01454AD0 ; short __cdecl ai_vehicle_get_num_reservations(long, e_game_team, bool)

long __cdecl ai_vehicle_get_reservation(long vehicle_index, long seat_index, long team)
long __cdecl ai_vehicle_get_reservation(long vehicle_index, long seat_index, e_game_team team_index)
{
return INVOKE(0x01454C00, ai_vehicle_get_reservation, vehicle_index, seat_index, team);
return INVOKE(0x01454C00, ai_vehicle_get_reservation, vehicle_index, seat_index, team_index);
}

//.text:01454C70 ; void __cdecl ai_vehicle_handle_allegiance_change(long)
//.text:01454D70 ; void __cdecl ai_vehicle_lock_actors(long, e_game_team)
//.text:01454EC0 ; bool __cdecl ai_vehicle_occupied_by_enemy(long, e_game_team)
//.text:01454FC0 ; bool __cdecl ai_vehicle_ready_for_lockdown(long, e_game_team)
//.text:01455040 ; bool __cdecl ai_vehicle_reserve_seat(long, long, long, real)
//.text:01455170 ; short __cdecl ai_vehicle_seat_count(long, bool)
//.text:014551E0 ; bool __cdecl ai_vehicle_seats_available(long, long)
//.text:01455300 ; bool __cdecl ai_vehicle_turret_valid_angle(long, long, long)
//.text:01455600 ; bool __cdecl ai_vehicle_turret_valid_distance(long, long, long, real)

6 changes: 5 additions & 1 deletion game/source/ai/ai_vehicles.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#pragma once

extern long __cdecl ai_vehicle_get_reservation(long vehicle_index, long seat_index, long team);
#include "cseries/cseries.hpp"

enum e_game_team;

extern long __cdecl ai_vehicle_get_reservation(long vehicle_index, long seat_index, e_game_team team);

0 comments on commit fbf73db

Please sign in to comment.