Magic effects are updated once before applying when resting
Fixing #7970 (closed).
When the player was resting, all their magic effects were applied throughout the rest duration, including the effects for already removed spells, which were applied once more before removal.
For example, when an MWScript had removed a player's vampire sun damage ability during sleep to return it when they wake, the sun damage effect would still apply.
However, a script like this one
Begin ElDivWhenSleeping
if ( GetPCSleep != 1 )
return
endif
player->AddSpell "divino"
player->RemoveSpell "divino"
End
,where "divino" is a magic ability with a Divine Intervention effect, should still work, i.e. teleport the player.
This commit, per the idea in #7970 (closed), calls an update to active magic effects before that applying, so that these removed spells are executed and removed and only then the real duration-long execution of remaining magic effects takes place.