# Kithgard Brawl glitch

**URL:** https://discourse.codecombat.com/t/kithgard-brawl-glitch/4251
**Category:** Bugs
**Created:** [June 17, 2015, 1:07pm UTC](https://discourse.codecombat.com/t/kithgard-brawl-glitch/4251 "2015-06-17T13:07:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Autri\_Basu](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@Autri\_Basu](https://discourse.codecombat.com/u/Autri_Basu)
#### Post date: [June 17, 2015, 1:07pm UTC](https://discourse.codecombat.com/t/kithgard-brawl-glitch/4251/1 "2015-06-17T13:07:48Z")

</div>

It seems that on line 8, evem though I defined enemy, it says that I need something to cast upon. here is my code

```python
loop:
    enemy = self.findNearest(self.findEnemies())
    if self.canCast("drain-life", enemy):
        self.cast("drain-life", enemy) #(line 8)
    if self.distanceTo(enemy) < self.attackRange:
        self.attack(enemy)
    if self.canCast("fear"):
        self.cast("fear")

```

I removed the comments  
also, I wont cast fear, attack, or do anything else

---

<div class="post-metadata">

### Author: ![ChronistGilver](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chronistgilver/32/3778_2.png) [@ChronistGilver](https://discourse.codecombat.com/u/ChronistGilver)
#### Post date: [June 17, 2015, 4:08pm UTC](https://discourse.codecombat.com/t/kithgard-brawl-glitch/4251/2 "2015-06-17T16:08:05Z")

</div>

You don’t check if there is an enemy in the first place. At the very beginning, it’s quite possible that there is none, so enemy is null. Therefore, you don’t have anything to cast upon.

---

<div class="post-metadata">

### Author: ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)
#### Post date: [June 19, 2015, 8:06pm UTC](https://discourse.codecombat.com/t/kithgard-brawl-glitch/4251/3 "2015-06-19T20:06:24Z")

</div>

Also, you have to cast `"fear"` on a target; it doesn’t work if you don’t specify a second argument.
