TStand90/roguelike_tutorial_revised

code does not set previous.ai = current.ai at any place

Opened this issue · 1 comments

causing a crash when the confuse spell expires.

That is no longer a problem: http://rogueliketutorials.com/tutorials/tcod/part-9/ sets previous_ai in the ConfusedMonster.__init__:

class ConfusedMonster:
    def __init__(self, previous_ai, number_of_turns=10):
        self.previous_ai = previous_ai
        self.number_of_turns = number_of_turns

and then when the component is created, the old entity.ai is passed as the argument

            confused_ai = ConfusedMonster(entity.ai, 10)
            confused_ai.owner = entity
            entity.ai = confused_ai