game/scenes: Remove side effects after && in arena_handle_events() subloop
This addresses a static analyser compaint.
@@ -820,12 +820,15 @@ int arena_handle_events(scene *scene, game_player *player, ctrl_event *i) {
do {
object_act(game_player_get_har(player), i->event_data.action);
write_rec_move(scene, player, i->event_data.action);
- // Rewritten this way, we possible skipped some events before.
- // We check if there is a next event, then check if it is EVENT_TYPE_ACTION
- // and only then we move the event iterator.
- // If conditions fail then we move to the next element at the end of the loop as usual.
- // This change also simplified the loop condition, we now don't need to check i for NULL.
- } while (i->next && i->next->type == EVENT_TYPE_ACTION && (i = i->next));
+ // Rewritten this way, we possible skipped some events
+ // before. We check if there is a next event, then
+ // check if it is EVENT_TYPE_ACTION and only then we
+ // move the event iterator. If conditions fail then we
+ // move to the next element at the end of the loop as
+ // usual.
+ if (i->next == NULL || i->next->type != EVENT_TYPE_ACTION)
+ break;
+ } while ((i = i->next) != NULL);
// always trigger a synchronization, since if the client's move did not actually happen, we want to rewind them ASAP
need_sync = 1;
} else {
