… | |
… | |
602 | tmp->range = spell->range + SP_level_range_adjust (caster, spell); |
602 | tmp->range = spell->range + SP_level_range_adjust (caster, spell); |
603 | tmp->attacktype = spell->attacktype; |
603 | tmp->attacktype = spell->attacktype; |
604 | tmp->x = x; |
604 | tmp->x = x; |
605 | tmp->y = y; |
605 | tmp->y = y; |
606 | tmp->direction = dir; |
606 | tmp->direction = dir; |
607 | if (get_owner (op) != NULL) |
607 | if (op->owner != NULL) |
608 | copy_owner (tmp, op); |
608 | tmp->set_owner (op); |
609 | else |
609 | else |
610 | set_owner (tmp, op); |
610 | tmp->set_owner (op); |
611 | tmp->level = caster_level (caster, spell); |
611 | tmp->level = caster_level (caster, spell); |
612 | set_spell_skill (op, caster, spell, tmp); |
612 | set_spell_skill (op, caster, spell, tmp); |
613 | |
613 | |
614 | /* needed for AT_HOLYWORD,AT_GODPOWER stuff */ |
614 | /* needed for AT_HOLYWORD,AT_GODPOWER stuff */ |
615 | if (tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) |
615 | if (tmp->attacktype & AT_HOLYWORD || tmp->attacktype & AT_GODPOWER) |
… | |
… | |
677 | * we then make the owner of this object the target. |
677 | * we then make the owner of this object the target. |
678 | * The owner could very well be no where near op. |
678 | * The owner could very well be no where near op. |
679 | */ |
679 | */ |
680 | if (op->type != PLAYER && op->type != RUNE) |
680 | if (op->type != PLAYER && op->type != RUNE) |
681 | { |
681 | { |
682 | tmp = get_owner (op); |
682 | tmp = op->owner; |
683 | /* If the owner does not exist, or is not a monster, than apply the spell |
683 | /* If the owner does not exist, or is not a monster, than apply the spell |
684 | * to the caster. |
684 | * to the caster. |
685 | */ |
685 | */ |
686 | if (!tmp || !QUERY_FLAG (tmp, FLAG_MONSTER)) |
686 | if (!tmp || !QUERY_FLAG (tmp, FLAG_MONSTER)) |
687 | tmp = op; |
687 | tmp = op; |