That's done in the event. You can look at the event that occurs when you touch one of the mammoths in the moogle battle at the beginning as an example. They do a similar thing there (putting the party at 1HP and not causing a game over).
EDIT: If bit $1DC9($40) [$1DD1, bit 0] is clear, then the party survived; if it is set, they have died.
EDIT: If bit $1DC9($40) [$1DD1, bit 0] is clear, then the party survived; if it is set, they have died.
