From d946850af43a01b160425a6dfa05e90468d7862e Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sat, 6 Apr 2019 09:33:27 +0800 Subject: [PATCH] Fixed the weapon duplication bug in NPC combat control mod. --- artifacts/mods/gl_partycontrol.int | Bin 3584 -> 3862 bytes artifacts/mods/gl_partycontrol.ssl | 13 +++++++++++++ 2 files changed, 13 insertions(+) diff --git a/artifacts/mods/gl_partycontrol.int b/artifacts/mods/gl_partycontrol.int index 4deb0bee5c21ee3cfa7e84e80856add915a491fa..9bcc1f98e0429b244cb114c13e11a227adf2d1e2 100644 GIT binary patch delta 1183 zcmZpWnIRiqfq?>traso>&W5MKmEaHqIlfSWKG9H_pz^cQy95)5+~jTSos8=yJ8)PFe`;U>DdYGAA|Vz`Zs3wL z0dYC=KqLbP$kvAa4f`9eH0*D9)36Opc)jrnSe&`R7!qLIEe-n{84fTqGB7NJ1rvAHWDf3xNh}@Lv=7U7(!Xh4Tc~yc-%lF19O8BByf48AU1$Rd88n@1{4J#(?Q7&B+kInz}lcc z0hFBofccCKMj##|2aMNLet_}M|Ns9R9GWV?!8zHHTb+mRUtj~ZAiy^ZMR3mK7T!!wNw6^-O-YmOxFrB( C*ZXw< delta 970 zcmbOx*B~R%z;u9-fq_A&ffqzGUzjK$ThGbBz`(|U0$AjrTnQ)*rNH9M3=9k^Pyr~# zGKYbIfr){E!2~J*rC5ES;y0iIP>PL(fq?j2NQ9MdvJGn{W5eWStU64ruO?q%jb!YbtjDG- zSOk)0U~CYAC}eY+oWy3x7&mzeTc#i%SdO(ps6ijZV*4_gk3Ck^0K{fs09gSF0hkr+ zO$`za`VCSbS@xvK6WHY$n^CO=Vee$jnB2x; z&AFz51*DE+&E!)Yx{Ml=e{jeOYJfx-*kEqs_%T_H(?^Q)21F_64X`u^%z2zqlY2NN zG@!y@_aO%X=duQg23MF1IpeZe(w!@vQ?*$z}zj9Yj}(V zxKB0kg2Uqvh-BoMypKnLiTlUo2Rteoyf47!GBgN5X$y$?JQgT=L?-X!k+f!O5C*B@ zEdY_=u+j&csMJ&j7GY>G1oMrcJfjB7#t;yj*I;r3uee}PBgE&74Td05o)eQ-@TxHJ zJeYirSB{BSWAZy*F(zJ#$!vUj8oUmWfQQFD%ncNKu#CC(0Y*CZ6VmdQPQnUj^d FgaI_R&GP^N diff --git a/artifacts/mods/gl_partycontrol.ssl b/artifacts/mods/gl_partycontrol.ssl index 8585f91f..559b7f16 100644 --- a/artifacts/mods/gl_partycontrol.ssl +++ b/artifacts/mods/gl_partycontrol.ssl @@ -102,6 +102,18 @@ procedure inventorymove_handler begin end end +procedure invenwield_handler begin + variable critter := get_sfall_arg, + item := get_sfall_arg, + slot := get_sfall_arg, + event := get_sfall_arg; + + // Fix weapon duplication when equipping in combat + if (event and AllowControl(obj_pid(critter))) then begin + set_flags(item, get_flags(item) bwand bwnot(FLAG_LEFT_HAND bwor FLAG_RIGHT_HAND)); + end +end + procedure start begin if (game_loaded and sfall_ver_major >= 4) then begin variable configSection := "CombatControl"; @@ -135,6 +147,7 @@ procedure start begin register_hook_proc(HOOK_COMBATTURN, combatturn_handler); register_hook_proc(HOOK_GAMEMODECHANGE, gamemodechange_handler); register_hook_proc(HOOK_INVENTORYMOVE, inventorymove_handler); + register_hook_proc(HOOK_INVENWIELD, invenwield_handler); end end end