mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-12 06:20:15 -04:00
Fix issue where edge-activated hats only run on one sprite when sprite is duplicated or cloned.
This commit is contained in:
parent
532e63da15
commit
19737d4e39
4 changed files with 101 additions and 3 deletions
src/engine
|
@ -1233,12 +1233,14 @@ class Runtime extends EventEmitter {
|
|||
/**
|
||||
* Update an edge-activated hat block value.
|
||||
* @param {!string} blockId ID of hat to store value for.
|
||||
* @param {!string} threadTargetId Target ID for the thread that the block belongs to
|
||||
* @param {*} newValue Value to store for edge-activated hat.
|
||||
* @return {*} The old value for the edge-activated hat.
|
||||
*/
|
||||
updateEdgeActivatedValue (blockId, newValue) {
|
||||
const oldValue = this._edgeActivatedHatValues[blockId];
|
||||
this._edgeActivatedHatValues[blockId] = newValue;
|
||||
updateEdgeActivatedValue (blockId, threadTargetId, newValue) {
|
||||
const blockAndTargetId = `${blockId}_${threadTargetId}`;
|
||||
const oldValue = this._edgeActivatedHatValues[blockAndTargetId];
|
||||
this._edgeActivatedHatValues[blockAndTargetId] = newValue;
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue