Closed daveloyall closed 2 years ago
Yeah, there was a bug where I was creating monsters using Monster::default()
, but because the Default
implementation was derived each monster would be created with zero health. That meant we never actually dealt any damage because of the let damage_received = cmp::min(self.health, amount)
.
Someone else caught me not properly testing my code after refactoring it, and I fixed the issue in f3a82d116da214bc71486da524b9492142acdc8b.
Hi.
Ok. But, the code in the playground doesn't seem to work.
Isn't it supposed to loop until the play has inflicted at least 100 damage?
I tried taking out that
break;
near the bottom, but then it just runs for a really long time. Way over 100 damage.I'm not sure yet, but since the post is live already, I thought I would let you know.
Cheers! By the way, I am enjoying your work and engaging with it, as you can see. :)