caught this error when I ran the following command (mark2)

Bugs will be moved here once resolved.

Post » Mon Aug 11, 2014 9:13 pm

Problem Description
I know this ended up in the "CLOSED BUGS" section because there was no capx.. oh well.. it took me some time to get around to making the 1 line capx.. so please see attached.

add key "timer" with value max(0,var_t)

VAR_T is a text variable. I suspect there's a casting issue and this throws up an error when executed in the browser.



Attach a Capx
casting_bug.capx


Description of Capx
two global variables, one text, one number. one event (on start of layout) that runs and assigns the maximum value of the text variable and a number... crash.

Steps to Reproduce Bug
- just run the capx
Observed Result

Assertion failure: Calling expvalue.set_float without number type

Stack trace:
[email protected]://localhost:50000/preview_prelude.js:16:4
[email protected]://localhost:50000/expressions.js:788:3
[email protected]://localhost:50000/system.js:2054:3
[email protected]://localhost:50000/expressions.js:255:3
[email protected]://localhost:50000/eveng.js:2049:3
[email protected]://localhost:50000/eveng.js:1741:4
[email protected]://localhost:50000/eveng.js:929:1
[email protected]://localhost:50000/eveng.js:886:4
[email protected]://localhost:50000/preview.js:4175:5
[email protected]://localhost:50000/preview.js:4094:4
[email protected]://localhost:50000/preview.js:4021:4
[email protected]://localhost:50000/preview.js:4003:3
[email protected]://localhost:50000/layout.js:365:3
[email protected]://localhost:50000/preview.js:1624:4
[email protected]://localhost:50000/preview.js:1479:4
[email protected]://localhost:50000/preview.js:524:3
[email protected]://localhost:50000/preview.js:5247:3
@http://localhost:50000/:93:3
x.Callbacks/[email protected]://localhost:50000/jquery-2.0.0.min.js:3:24576
x.Callbacks/[email protected]://localhost:50000/jquery-2.0.0.min.js:3:25388
[email protected]://localhost:50000/jquery-2.0.0.min.js:3:2822
[email protected]://localhost:50000/jquery-2.0.0.min.js:3:466

Expected Result
not to crash

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
WIN8.1

Construct 2 Version ID
175 & 176
You do not have the required permissions to view the files attached to this post.
B
7
S
3
G
1
Posts: 184
Reputation: 1,352

Post » Wed Aug 13, 2014 2:51 pm

Thanks, fixed for next build. Note min and max only work with numbers, so the fix is that they will just ignore text values and treat them as 0.
Scirra Founder
B
397
S
236
G
88
Posts: 24,412
Reputation: 194,514


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests