diff --git a/lesson-2/chapter-8/zombiefeeding.sol b/lesson-2/chapter-8/zombiefeeding.sol index 5de9e21..48cf4ad 100644 --- a/lesson-2/chapter-8/zombiefeeding.sol +++ b/lesson-2/chapter-8/zombiefeeding.sol @@ -5,9 +5,9 @@ contract ZombieFeeding is ZombieFactory { function feedAndMultiply(uint _zombieId, uint _targetDna) public { require(msg.sender == zombieToOwner[_zombieId]); Zombie storage myZombie = zombies[_zombieId]; - _targetDna = _targetDna % dnaModulus; + require(_targetDna == _targetDna % dnaModulus); uint newDna = (myZombie.dna + _targetDna) / 2; _createZombie("NoName", newDna); } -} \ No newline at end of file +}