Browse Source

Reset player.current_prestroke if we deleted last prestroke of theirs

sdf
A.Olokhtonov 2 months ago
parent
commit
86193fe26d
  1. 8
      client/webgl_geometry.js

8
client/webgl_geometry.js

@ -250,6 +250,10 @@ function geometry_clear_oldest_prestroke(state, context, player_id) {
const player = state.players[player_id]; const player = state.players[player_id];
player.strokes.shift(); player.strokes.shift();
if (player.strokes.length === 0) {
player.current_prestroke = false;
}
recompute_dynamic_data(state, context); recompute_dynamic_data(state, context);
} }
@ -259,6 +263,10 @@ function geometry_clear_newest_prestroke(state, context, player_id) {
const player = state.players[player_id]; const player = state.players[player_id];
player.strokes.pop(); player.strokes.pop();
if (player.strokes.length === 0) {
player.current_prestroke = false;
}
recompute_dynamic_data(state, context); recompute_dynamic_data(state, context);
} }

Loading…
Cancel
Save