- if( !(cell_current->state & FLAG_TARGETED) )
- cell_current->state ^= FLAG_FLIP_FLOP;
- }
- else if( cell_current->config == k_cell_type_merge )
- {
- // Can only move up
- fish->dir[0] = 0;
- fish->dir[1] = -1;
+ struct cell *cell_entry = pcell( fish->pos );
+
+ if( !(cell_entry->state & (FLAG_INPUT|FLAG_CANAL|FLAG_OUTPUT) ))
+ {
+ if( world_check_pos_ok( fish->pos ) )
+ fish->state = k_fish_state_bg;
+ else
+ fish->state = k_fish_state_dead;
+ }
+ else
+ {
+ if( fish->dir[0] )
+ {
+ if( cell_entry->config == k_cell_type_split ||
+ cell_entry->config == k_cell_type_ramp_right ||
+ cell_entry->config == k_cell_type_ramp_left )
+ {
+ // Special death (FALL)
+ /*
+ v2_sub( fish->physics_co, fish->physics_v, fish->physics_v );
+ v2_divs( fish->physics_v, vg_time_delta, fish->physics_v );
+ */
+
+ fish->state = k_fish_state_dead;
+ vg_error( "REMOVE THIS CONDITION\n" );
+ continue;
+ }
+ }
+
+ if( cell_entry->config == k_cell_type_split )
+ {
+ sfx_set_playrnd( &audio_splitter, &audio_system_balls_important, 0, 1 );
+ cell_entry->state |= FLAG_FLIP_ROTATING;
+ }
+ }