diff --git a/TemplePlus/condition.cpp b/TemplePlus/condition.cpp index 6287bbf7f..bf3dc2c31 100644 --- a/TemplePlus/condition.cpp +++ b/TemplePlus/condition.cpp @@ -1825,8 +1825,10 @@ int ArmorCritMultiplier(DispatcherCallbackArgs args) int ShieldBashProficiencyPenalty(DispatcherCallbackArgs args) { auto dispIo = dispatch.DispIoCheckIoType5(args.dispIO); - auto invIdx = args.GetCondArg(2); auto attacker = dispIo->attackPacket.attacker; + if (!attacker) return 0; + + auto invIdx = args.GetCondArg(2); auto shield = inventory.GetItemAtInvIdx(attacker, invIdx); if (dispIo->attackPacket.weaponUsed != shield) return 0; diff --git a/tpdatasrc/tpgamefiles/rules/d20_combat/to_hit_processing.py b/tpdatasrc/tpgamefiles/rules/d20_combat/to_hit_processing.py index 69f9f0dfa..20bc80235 100644 --- a/tpdatasrc/tpgamefiles/rules/d20_combat/to_hit_processing.py +++ b/tpdatasrc/tpgamefiles/rules/d20_combat/to_hit_processing.py @@ -73,6 +73,7 @@ def mirror_image_attack_roll(d20a): #Performer to Hit Bonus to_hit = tpdp.EventObjAttack() + to_hit.attack_packet.attacker = performer to_hit.dispatch(performer, OBJ_HANDLE_NULL, ET_OnToHitBonus2, EK_NONE) to_hit_dice = dice_new("1d20")