From f33f356b7ad104e2567052a045de72adf52af2d7 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sun, 16 Dec 2018 08:57:17 +0800 Subject: [PATCH] Fixed NPC armor appearance mod preventing other critters from using weapons due to incorrect return value in check_weapon_change() (#222) --- artifacts/mods/gl_npcarmor.int | Bin 3664 -> 3650 bytes artifacts/mods/gl_npcarmor.ssl | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/artifacts/mods/gl_npcarmor.int b/artifacts/mods/gl_npcarmor.int index c6cfde80ae5de2c7fe1cf9e1e027579edb850c12..9272cd4c4f288803f9dafba4613c687b4becb827 100644 GIT binary patch delta 580 zcmca0b4X@Fr{@a>2xx#%Fp|9m%9;YDp%jM}l(7a%Ln%&+jhEgtvRX8-G-yvw;1t_@ zhpC>C@xtVLOlC~17bZ_(@nqaL`5wzD83u+1-Ui7Atp?2oo(7o%j0_B{7aCX&F#iAl z|Nmq*7O%;FSasE3fW#RX8jKpGK`geY28jm!1}PAmfe|iRF*$%umT|>o2X<9K#s*ff zEK`Fah-P~+c?p}jYYvEwFo&H7n>p-SNTSRQMqoXR4aN=nAQpSnWC!+CMxn{e*i{){ zOg_VI&L}jQg(Ikb3tZ8r{^^W2xx#%Fp_-|lr;rPLn#gmC}RzjhEkkv8!x?QWOZv`Y0#ehfmLkt z9j1Cl#(k6TF_|&3?wdS?#glQ(AT!35$yPQA%F9FmM{Cbx0O+rL7xnE~n( zxXm0OS%l3ndAQA-GL!eQt54?UoWgCnh#&wg^c*7ahChz0TWS-W* JGFgFB0subkig5q{ diff --git a/artifacts/mods/gl_npcarmor.ssl b/artifacts/mods/gl_npcarmor.ssl index d6476dd3..e05147db 100644 --- a/artifacts/mods/gl_npcarmor.ssl +++ b/artifacts/mods/gl_npcarmor.ssl @@ -53,12 +53,13 @@ procedure check_weapon_change(variable critter, variable item, variable isWield) foreach (i in weaponAnimList) begin if (newWeaponAnim == atoi(i)) then return -1; end + return 0; end else begin // anim code 0 - none/unarmed return -1; end end end - return 0; + return -1; end // for NPCs when they change armor/weapon themselves @@ -76,7 +77,7 @@ procedure invenwield_handler begin end end - if (critter and item and (slot == INVEN_TYPE_RIGHT_HAND or slot == INVEN_TYPE_LEFT_HAND)) then begin + if (critter and item and slot == INVEN_TYPE_RIGHT_HAND) then begin canWield := check_weapon_change(critter, item, isWorn); set_sfall_return(canWield); end