[mod] Move general injections into mod library.

This commit is contained in:
lzwdgc 2024-04-22 02:49:47 +03:00
parent 0c0adeda4c
commit 01121ae523
2 changed files with 14 additions and 8 deletions

View file

@ -135,7 +135,7 @@ int main(int argc, char *argv[]) {
"IF(_ISGLIDER(GL_S2_PA_SINYGR)|_ISGLIDER(GL_S4_S_SINYGR))"); "IF(_ISGLIDER(GL_S2_PA_SINYGR)|_ISGLIDER(GL_S4_S_SINYGR))");
// patch note: * _ISGLIDER() function can check exact glider name now, for example _ISGLIDER(GL_M3_A_FIRST1) (lz) // patch note: * _ISGLIDER() function can check exact glider name now, for example _ISGLIDER(GL_M3_A_FIRST1) (lz)
mod.make_injection(aim1_fix::script_function__ISGLIDER); mod.make_script_engine_injections();
// end of scripts section // end of scripts section
// patch note: // patch note:
@ -181,13 +181,7 @@ int main(int argc, char *argv[]) {
// patch note: double light weapons: GL_M2_PA_NARGOON and GL_S3_PS_FINDER1 // patch note: double light weapons: GL_M2_PA_NARGOON and GL_S3_PS_FINDER1
// patch note: double heavy weapons: GL_M3_PA_EYEDSTONE and GL_S3_PS_FINDER2 // patch note: double heavy weapons: GL_M3_PA_EYEDSTONE and GL_S3_PS_FINDER2
// patch note: (still have many bugs related) // patch note: (still have many bugs related)
mod.make_injection(aim1_fix::trade_actions_weapon_checks); mod.make_double_weapon_injections();
mod.make_injection(aim1_fix::setup_proper_weapon_slots_for_a_glider);
mod.make_injection(aim1_fix::put_weapon_into_the_right_slot_after_purchase);
mod.make_injection(aim1_fix::sell_correct_weapon);
mod.make_injection(aim1_fix::empty_light_weapon_message);
mod.make_injection(aim1_fix::empty_heavy_weapon_message);
mod.make_injection(aim1_fix::can_leave_trade_window);
// patch note: // patch note:
// test scripts // test scripts

View file

@ -419,6 +419,18 @@ struct mod_maker {
log("making injection on the virtual address 0x{:0X} (real address 0x{:0X}), size {}", virtual_address, ptr - f.p, log("making injection on the virtual address 0x{:0X} (real address 0x{:0X}), size {}", virtual_address, ptr - f.p,
size); size);
} }
void make_double_weapon_injections() {
make_injection(aim1_fix::trade_actions_weapon_checks);
make_injection(aim1_fix::setup_proper_weapon_slots_for_a_glider);
make_injection(aim1_fix::put_weapon_into_the_right_slot_after_purchase);
make_injection(aim1_fix::sell_correct_weapon);
make_injection(aim1_fix::empty_light_weapon_message);
make_injection(aim1_fix::empty_heavy_weapon_message);
make_injection(aim1_fix::can_leave_trade_window);
}
void make_script_engine_injections() {
make_injection(aim1_fix::script_function__ISGLIDER);
}
#endif #endif
#define ENABLE_DISABLE_FUNC(name, enable, disable) \ #define ENABLE_DISABLE_FUNC(name, enable, disable) \