Scirra / Construct-bugs

Public bug report submissions for Construct 3 and Construct Animate. Please read the guidelines then click the 'Issues' tab to get started.
https://www.construct.net
107 stars 83 forks source link

SDK v2 - Passing a LayerNumber or LayerName from a Sprite to an action of custom addon throws an exception #8224

Closed sotano42 closed 3 weeks ago

sotano42 commented 3 weeks ago

Problem description

When passing a LayerName or a LayerNumber to an action of a custom plugin, construct fails to read the ILayer interface from the referenced Sprite image

Attach a .c3p

Project: test-layer.zip Addon: singleGlobalPlugin wLayer.zip

Steps to reproduce

  1. Install the attached singleGlobalPlugin addon
  2. Open the project and run it
  3. Construct will throw an exception and the project won't run

Observed result

Passing a layer from an Sprite to a custom action fails.

Expected result

Passing a layer as parameter should work.

More details

r406-2 Beta

System details

View details Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'GetSdkInstance') at ObjectExpressionNode.ExpObject (expNode.js:7:330) at LayerExpressionParameter._expressionFunc (expTable.js:99:20) at LayerExpressionParameter.GetLayer (parameter.js:8:299) at LayerExpressionParameter.GetILayer (parameter.js:8:432) at Action.RunSingleAct_1param [as Run] (action.js:18:75) at EventBlock._RunActions_Fast (eventBlock.js:26:466) at EventBlock._RunAndBlock (eventBlock.js:25:88) at EventBlock.Run (eventBlock.js:22:11) at EventSheet._ExecuteTrigger (eventSheet.js:19:154) at EventSheet._TriggerForClass (eventSheet.js:13:302)
AshleyScirra commented 3 weeks ago

Fixed for next release.