mirror of
https://github.com/elmasas/lcs-recomp
synced 2026-10-23 00:00:52 -04:00
Fix delete_char on player
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "psprecomp/runtime.hpp"
|
||||
#include "generated_units.hpp"
|
||||
#include "lcs_controls.hpp"
|
||||
#include <bit>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
@@ -4107,6 +4108,7 @@ L_0895DA60:
|
||||
if (rt.invoke_chained_direct<&recomp_unit_0189_entry, 189u, 840u, 0x08AFBA58u>(ctx, &aot_mem) && ctx.pc == 0x0895DA70u) goto L_0895DA70;
|
||||
return;
|
||||
L_0895DA70:
|
||||
if (ctx.gpr[2] != 0u && ctx.gpr[2] == lcs::lcs_guest_player_ped(aot_mem)) goto L_0895DA78;
|
||||
ctx.gpr[31] = (0x0895DA78u);
|
||||
ctx.gpr[4] = (ctx.gpr[2] | 0u);
|
||||
if (rt.invoke_chained_direct<&recomp_unit_0030_entry, 30u, 135u, 0x0887C9D8u>(ctx, &aot_mem) && ctx.pc == 0x0895DA78u) goto L_0895DA78;
|
||||
|
||||
@@ -20,9 +20,14 @@ void lcs_note_vehicle_control_read() noexcept;
|
||||
[[nodiscard]] bool lcs_player_in_vehicle() noexcept;
|
||||
|
||||
template <typename Memory>
|
||||
[[nodiscard]] bool lcs_guest_player_in_vehicle(Memory &memory) {
|
||||
[[nodiscard]] std::uint32_t lcs_guest_player_ped(Memory &memory) {
|
||||
const std::uint32_t slot = memory.aot_load8(0x08B5E054u);
|
||||
const std::uint32_t ped = memory.aot_load32(0x08B89A10u + slot * 368u);
|
||||
return memory.aot_load32(0x08B89A10u + slot * 368u);
|
||||
}
|
||||
|
||||
template <typename Memory>
|
||||
[[nodiscard]] bool lcs_guest_player_in_vehicle(Memory &memory) {
|
||||
const std::uint32_t ped = lcs_guest_player_ped(memory);
|
||||
return ped != 0u && memory.aot_load8(ped + 1336u) != 0u;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user