From 1c827df52ab70201f51c44a3ed7bdda34e18d959 Mon Sep 17 00:00:00 2001 From: jugeeya Date: Thu, 22 Oct 2020 21:03:20 -0700 Subject: [PATCH] Quickfix for infinite shield --- src/hitbox_visualizer/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/hitbox_visualizer/mod.rs b/src/hitbox_visualizer/mod.rs index 547ffc9..0fdfba8 100644 --- a/src/hitbox_visualizer/mod.rs +++ b/src/hitbox_visualizer/mod.rs @@ -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 = + (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