View Single Post
Old 11-01-2009, 08:42 PM   #27
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Your code doesn't work the first time because you can't set a unit's hp above it's max hp, so when you try to increase the unit's life to nullify the damage the life doesn't get increased and so the damage isn't "prevented" like you think it should be.

This is only one out of many problems we encounter when trying to prevent damage; that's precisely why I wrote the DamageModifiers library, so it handles all the nuances of damage prevention for you. You should use DamageModifiers instead of a DamageEvent response.
__________________
Anitarf is offline   Reply With Quote