fix: don't randomize components if we're cloning an existing ped (#2663)

This commit is contained in:
maybegreat48
2024-01-28 14:51:25 +00:00
committed by GitHub
parent 96048fa0f6
commit 1e11d83f7a
3 changed files with 20 additions and 21 deletions

View File

@ -3,8 +3,22 @@
#include "gta/enums.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "util/is_key_pressed.hpp"
#include "windows.h"
#include "pointers.hpp"
namespace
{
inline bool is_key_pressed(uint16_t key)
{
if (GetForegroundWindow() == big::g_pointers->m_hwnd)
{
if (GetAsyncKeyState(key) & 0x8000)
{
return true;
}
}
return false;
}
}
namespace big
{
@ -42,7 +56,7 @@ namespace big
void update_key_state(key_state& key_last_tick)
{
if (big::is_key_pressed(key_last_tick.v_key))
if (is_key_pressed(key_last_tick.v_key))
{
switch (key_last_tick.state)
{