core: Ignore newer PlaceObject tag in same frame with duplicate depth
If we have two PlaceObject tags in the same frame with the same depth, only the first one actually places an object. The second one is ignored (Flash Player logs a warning).
This commit is contained in:
parent
d037038170
commit
0d5ead4c02
|
@ -4439,7 +4439,12 @@ impl QueuedTagList {
|
||||||
fn queue_add(&mut self, add_tag: QueuedTag) {
|
fn queue_add(&mut self, add_tag: QueuedTag) {
|
||||||
let new = match self {
|
let new = match self {
|
||||||
QueuedTagList::None => QueuedTagList::Add(add_tag),
|
QueuedTagList::None => QueuedTagList::Add(add_tag),
|
||||||
QueuedTagList::Add(_) => QueuedTagList::Add(add_tag),
|
QueuedTagList::Add(existing) => {
|
||||||
|
// Flash player traces "Warning: Failed to place object at depth 1.",
|
||||||
|
// so let's log a warning too.
|
||||||
|
tracing::warn!("Ignoring queued tag {add_tag:?} at same depth as {existing:?}");
|
||||||
|
QueuedTagList::Add(*existing)
|
||||||
|
}
|
||||||
QueuedTagList::Remove(r) => QueuedTagList::RemoveThenAdd(*r, add_tag),
|
QueuedTagList::Remove(r) => QueuedTagList::RemoveThenAdd(*r, add_tag),
|
||||||
QueuedTagList::RemoveThenAdd(r, _) => QueuedTagList::RemoveThenAdd(*r, add_tag),
|
QueuedTagList::RemoveThenAdd(r, _) => QueuedTagList::RemoveThenAdd(*r, add_tag),
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package {
|
||||||
|
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
|
||||||
|
|
||||||
|
public class FirstChild extends MovieClip {
|
||||||
|
|
||||||
|
|
||||||
|
public function FirstChild() {
|
||||||
|
trace("Constructed FirstChild");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package {
|
||||||
|
|
||||||
|
import flash.display.MovieClip;
|
||||||
|
|
||||||
|
|
||||||
|
public class SecondChild extends MovieClip {
|
||||||
|
|
||||||
|
|
||||||
|
public function SecondChild() {
|
||||||
|
trace("Constructed SecondChild")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
Constructed FirstChild
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,3 @@
|
||||||
|
# NOTE - test.swf is manually edited to have two PlaceObject tags
|
||||||
|
# in the same frame with the same depth
|
||||||
|
num_frames = 1
|
Loading…
Reference in New Issue