Commit e176294 pushed taking damage later in effect_handler_EARTHQUAKE(). However, the "damage" variable is used as a global variable in that function and overwritten by monster damage on line 1492 if a monster takes damage from the quake, so the value on line 1554 may be incorrect. The code should use a different variable for monster damage.