Skip to content

Commit d9c78a7

Browse files
committed
Fix self-targeting spell check after Dweomer Shield processing
Closes #79
1 parent 3e3bc75 commit d9c78a7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/game/magictech.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4370,8 +4370,12 @@ bool sub_455550(S603CB8* a1, MagicTechRunInfo* run_info)
43704370
int64_t parent_obj;
43714371

43724372
a1->field_60 = 0;
4373-
if (a1->field_20 == OBJ_HANDLE_NULL
4374-
|| a1->field_20 == dword_5E75F0->parent_obj.obj) {
4373+
4374+
// FIX: Move the self-targeting spell check below, after handling the
4375+
// effects of the "Dweomer Shield". This prevents the execution of end
4376+
// actions for spells that didn't even have a chance to begin (the result of
4377+
// interrupting a spell during the initial processing).
4378+
if (a1->field_20 == OBJ_HANDLE_NULL) {
43754379
return true;
43764380
}
43774381

@@ -4395,6 +4399,10 @@ bool sub_455550(S603CB8* a1, MagicTechRunInfo* run_info)
43954399
return false;
43964400
}
43974401

4402+
if (a1->field_20 == dword_5E75F0->parent_obj.obj) {
4403+
return true;
4404+
}
4405+
43984406
if (((a1->field_60 & OSF_FULL_REFLECTION) == 0
43994407
&& (run_info->flags & MAGICTECH_RUN_REFLECTED) == 0)
44004408
|| (dword_5E7598->flags & MAGICTECH_NO_REFLECT) != 0) {

0 commit comments

Comments
 (0)