This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/script_function.cpp
Arthur 09b91ca6d7
Some checks are pending
Nightly Build / Build Nightly (push) Blocked by required conditions
Nightly Build / Recreate Release (push) Blocked by required conditions
Nightly Build / Check Recent Commit (push) Successful in 20s
Add Return Value Support for Script Functions (#3479)
* Add Return Value Support for Script Functions
* Removed address-of operator on instruction_pointer parameter, as sol is pass-by-value.
* Fixed reset_session_data & start_creator_script
* Added support for Vector3 and updated casting for bool type for proper conversion to Lua boolean
* Updated documentation for scr_function
* Added get_int method and updated param names for script functions
* Fix #3497 graceful landing not saved.
* Added a check in view_lsc to see if the vehicle can accept clan logos first.
* Fixed vehicle clan logo SP bypass not working properly.
* Fixed COPY VEHICLE not giving persist_car_service::spawn_vehicle_json the target's ped so it can copy their clan logo and not ours.
Fixed spawn_vehicle_json calling add_clan_logo_to_vehicle with our logo and not the ped parameter's logo.
* Added Clone Player Car.
* Fixed has_clan_logo check in view_lsc being given the wrong parameter.

---------

Co-authored-by: gir489 <100792176+gir489returns@users.noreply.github.com>
2024-08-06 14:46:48 +02:00

30 lines
700 B
C++

#include "script_function.hpp"
namespace big
{
script_function::script_function(const std::string& name, const rage::joaat_t script, const std::string& pattern) :
m_name(name),
m_script(script),
m_pattern(pattern),
m_ip(0)
{
}
uint32_t script_function::get_ip(rage::scrProgram* program)
{
if (m_ip != 0)
return m_ip;
if (auto location = scripts::get_code_location_by_pattern(program, m_pattern))
{
m_ip = *location;
LOG(VERBOSE) << "Found pattern " << m_name << " at " << HEX_TO_UPPER(m_ip) << " in script " << program->m_name;
}
else
{
LOG(FATAL) << "Failed to find pattern " << m_name << " in script " << program->m_name;
}
return m_ip;
}
}