-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getPedControlState is broken #3992
Comments
First argument should be ped now but before this it worked without that, vanilla freecam uses same way, this could cause compatible issues with older scripts. (update: pushed fix for default resources - multitheftauto/mtasa-resources#598) |
I tried to fix the problem in the following way and restore the old, but otherwise stupid, pointless way for backwards compatibility, but the argument parser does not currently allow this, so I would like to ask for help with this. bool CLuaPedDefs::GetPedControlState(const std::variant<CClientPed*, std::string>& first, const std::optional<std::string>& second) noexcept
{
bool state;
CClientPed* ped;
std::string control;
if (std::holds_alternative<CClientPed*>(first))
{
ped = std::get<CClientPed*>(first);
if (!second)
return false;
control = *second;
}
else if (std::holds_alternative<std::string>(first))
{
ped = CStaticFunctionDefinitions::GetLocalPlayer();
control = std::get<std::string>(first);
}
if (!ped)
return false;
if (!CStaticFunctionDefinitions::GetPedControlState(*ped, control, state))
return false;
return state;
} |
static_assert(sizeof(T) == 0, "Invalid parameter type provided to CLuaFunctionParser!"); |
getControlState suffers the same |
Describe the bug
getPedControlState totally stopped working after #3964
Steps to reproduce
Start editor with latest nightly
Version
Multi Theft Auto v1.6-release-22934
Additional context
No response
Relevant log output
Security Policy
The text was updated successfully, but these errors were encountered: