1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-10-03 01:34:27 +00:00

Quickfix for infinite shield

This commit is contained in:
jugeeya 2020-10-22 21:03:20 -07:00 committed by GitHub
parent c3db5a74ac
commit 1c827df52a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -213,6 +213,22 @@ unsafe fn handle_attack(lua_state: u64) {
unsafe fn mod_handle_attack(lua_state: u64) {
let mut l2c_agent = L2CAgent::new(lua_state);
// necessary if param object fails
// hacky way of forcing no shield damage on all hitboxes
if MENU.shield_state == Shield::Infinite {
let hitbox_params: Vec<L2CValue> =
(0..36).map(|i| l2c_agent.pop_lua_stack(i + 1)).collect();
l2c_agent.clear_lua_stack();
for i in 0..36 {
let mut x = hitbox_params[i];
if i == 20 {
l2c_agent.push_lua_stack(&mut L2CValue::new_num(-999.0));
} else {
l2c_agent.push_lua_stack(&mut x);
}
}
}
// Hitbox Visualization
if MENU.hitbox_vis == HitboxVisualization::On {
// get all necessary grabbox params