You're right! The following line was inside an else statement, so unreachable to the Earthquake event:
if ((space[youx][youy] != MAP_TEMPLE) && (space[youx][youy] != MAP_STAIRS))
space[youx][youy] = MAP_RUBBLE;
The else has been removed. Thank you!