# A bug in my own level

**URL:** <https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719>\
**Category:** Bugs\
**Created:** [September 28, 2021, 1:20pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719 "2021-09-28T13:20:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 28, 2021, 1:20pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/1 "2021-09-28T13:20:07Z")

</div>

Hello, I like making ripoffs so I made Sky Wars. Hope you enjoy!

> **[CodeCombat - Coding games to learn Python and JavaScript](https://codecombat.com/play/ladder/sky-wars)**
>
> Learn typed code through a programming game. Learn Python, JavaScript, and HTML as you solve puzzles and learn to make your own coding games and websites.

**BUG: Everyone who uses some long code get’s this image below.**  
[![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/b/f/bfa5c85ebba3f53739b57dffd4560b1bd92c9ee4.jpeg) ](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/b/f/bfa5c85ebba3f53739b57dffd4560b1bd92c9ee4.jpeg)

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 28, 2021, 1:43pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/2 "2021-09-28T13:43:14Z")

</div>

Lol

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/0/1/01ba87149f55ab97004b720dbc58562bf78a3256.jpeg)

---

<div class="post-metadata">

**Author:** ![strongster](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@strongster](https://discourse.codecombat.com/u/strongster)\
**Post date:** [September 28, 2021, 6:56pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/3 "2021-09-28T18:56:44Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/b/f/bfa5c85ebba3f53739b57dffd4560b1bd92c9ee4.jpeg)  
Is this an error on my code, or on your game?  
Here is my code:

```python
# Be sure to click the Hints and read the Quickstart Guide!
summonOrder = ["librarian", "necromancer", "goliath", "trapper", "knight", "ninja"]
summonIndex = 0

enemyBoss = hero.findByType("wizard-ninja", hero.findEnemies())[0]

if hero.team == "humans":
    targetPos = {"x": 72, "y": 32}
else:
    targetPos = {"x": 10, "y": 32}

def necromancerLogic(necromancer):
    enemy = necromancer.findNearestEnemy()
    if enemy:
        if necromancer.isReady("summon-undead"):
            hero.command(necromancer, "cast", "summon-undead")
        else:
            hero.command(necromancer, "attack", enemy)

def librarianLogic(librarian):
    friends = librarian.findFriends()
    enemy = librarian.findNearestEnemy()
    for friend in friends:
        if friend:
            if librarian.isReady("haste"):
                hero.command(librarian, "cast", "haste", friend)
            elif librarian.isReady("grow"):
                hero.command(librarian, "cast", "grow", friend)
            elif librarian.isReady("force-bolt"):
                hero.command(librarian, "cast", "force-bolt", enemy)
            else:
                hero.command(librarian, "attack", enemy)

def goliathLogic(goliath):
    enemy = goliath.findNearestEnemy()
    if enemy:
        if goliath.isReady("hurl"):
            hero.command(goliath, "hurl", enemy)
        # The hero has access to "stomp" and "warcry" as well:
        elif goliath.isReady("stomp"):
            hero.command(goliath, "stomp", enemy)
        elif goliath.isReady("warcry"):
            hero.command(goliath, "warcry", enemy)
        else:
            hero.command(goliath, "attack", enemy)

while True:
    nextUnit = summonOrder[summonIndex % summonOrder.length]
    if hero.costOf(nextUnit) <= hero.gold:
        hero.summon(nextUnit)
        summonIndex += 1
    friends = hero.findFriends()
    for friend in friends:
        if friend.type == "goliath":
            goliathLogic(friend)
        elif friend.type == "librarian":
            librarianLogic(friend)
        elif friend.type == "necromancer":
            necromancerLogic(friend)
        else:
            hero.command(friend, "attack", friend.findNearestEnemy())

```

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 28, 2021, 7:20pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/4 "2021-09-28T19:20:11Z")

</div>

That same error happened to me.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 28, 2021, 7:20pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/5 "2021-09-28T19:20:22Z")

</div>

It’s codecombat’s bug.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 28, 2021, 7:20pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/6 "2021-09-28T19:20:30Z")

</div>

I’ll ping staff [@staff](https://discourse.codecombat.com/groups/staff)

---

<div class="post-metadata">

**Author:** ![strongster](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@strongster](https://discourse.codecombat.com/u/strongster)\
**Post date:** [September 28, 2021, 7:48pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/7 "2021-09-28T19:48:51Z")

</div>

[@staff](https://discourse.codecombat.com/groups/staff) we have a problem with this level

---

<div class="post-metadata">

**Author:** ![moonwatcher348](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/moonwatcher348/32/24126_2.png) [@moonwatcher348](https://discourse.codecombat.com/u/moonwatcher348)\
**Post date:** [September 29, 2021, 8:54pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/8 "2021-09-29T20:54:56Z")

</div>

This is a problem that hasn’t been solved for quite a while, and it only happens when you use Vector methods.

---

<div class="post-metadata">

**Author:** ![moonwatcher348](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/moonwatcher348/32/24126_2.png) [@moonwatcher348](https://discourse.codecombat.com/u/moonwatcher348)\
**Post date:** [September 29, 2021, 9:05pm UTC](https://discourse.codecombat.com/t/a-bug-in-my-own-level/30719/9 "2021-09-29T21:05:18Z")

</div>

You can’t see your assassins if they phase shift… and therefore can’t command them… please fix this.
