Removed some code that was double checking without any need.

This commit is contained in:
michiel2005 2023-07-14 22:55:45 +02:00 committed by kmeisthax
parent c812a8af54
commit fc32dc3671
1 changed files with 5 additions and 15 deletions

View File

@ -1272,11 +1272,11 @@ impl Player {
} }
} }
} }
if let Some(pressed) = context.mouse_down_object { if let Some(pressed) = context.mouse_down_object {
if !context.is_action_script_3() && pressed.as_displayobject().avm1_removed() { if !context.is_action_script_3() && pressed.as_displayobject().avm1_removed() {
context.mouse_down_object = None; context.mouse_down_object = None;
let mut display_object = None; let mut display_object = None;
if let Some(root_clip) = context.stage.root_clip() { if let Some(root_clip) = context.stage.root_clip() {
display_object = Self::find_first_character_instance( display_object = Self::find_first_character_instance(
root_clip, root_clip,
@ -1285,21 +1285,11 @@ impl Player {
} }
if let Some(new_down_object) = display_object { if let Some(new_down_object) = display_object {
if new_down_object.depth() == pressed.as_displayobject().depth() if let Some(state) = pressed.as_displayobject().state() {
&& Arc::ptr_eq( new_down_object.set_state(context, state);
&new_down_object.movie(),
&pressed.as_displayobject().movie(),
)
{
if let Some(state) = pressed.as_displayobject().state() {
new_down_object.set_state(context, state);
}
context.mouse_down_object = if display_object.is_some() {
new_down_object.as_interactive()
} else {
None
};
} }
context.mouse_down_object = new_down_object.as_interactive();
} }
} }
} }