(Important bug) Dim variables in "with" statements [Fixed Patch 31.1]

Description: Report bugs of SMBX-38A here.
Forum rules: https://wohlsoft.ru/forum/viewtopic.php?f=64&t=1069
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 403
Posts: 762
Joined: 9 Nov 2015
Website Youtube channel URL

Post #1by Lx Xzit » 20 Sep 2020, 10:09

When you use a dim variable and then use a "with" block, accessing to this object's variables will result in "Access Violation" error.

For example:

Code: Select all

dim i as integer
with npc(1)
    .xsp = 1 'stops the script
end with


This bug breaks basically all my scripts.
By the way, it reminds me to the "struct" bug I reported that hasn't been fixed yet.

Void
Bat
Bat
Avatar
Void
Bat
Bat
Age: 21
Reputation: 102
Posts: 279
Joined: 18 Apr 2014
Location: [REDACTED]

Post #2by Void » 29 Nov 2020, 9:39

Lx Xzit wrote:When you use a dim variable and then use a "with" block, accessing to this object's variables will result in "Access Violation" error.

For example:

Code: Select all

dim i as integer
with npc(1)
    .xsp = 1 'stops the script
end with


This bug breaks basically all my scripts.
By the way, it reminds me to the "struct" bug I reported that hasn't been fixed yet.
I think this should be stickied and (hopefully) fixed ASAP. Most experienced scripters are actually using the dim variable ever since it's been discovered, so to see basically half of the scripts break in patch 31 is really upsetting to a lot of people, including myself. As a result I've been discouraging people from using patch 31.
Join the SMBX 38a Discord Server!
Image

sweep a leaf sweep away a troubles

Omega02 M
Our friend
Our friend
Avatar
Omega02 M
Our friend
Our friend
Age: 20
Reputation: 25
Posts: 72
Joined: 30 May 2020
Youtube channel URL

Post #3by Omega02 » 23 Dec 2020, 14:41

Lx Xzit wrote:When you use a dim variable and then use a "with" block, accessing to this object's variables will result in "Access Violation" error.

For example:

Code: Select all

dim i as integer
with npc(1)
    .xsp = 1 'stops the script
end with


This bug breaks basically all my scripts.
By the way, it reminds me to the "struct" bug I reported that hasn't been fixed yet.

This has been fixed in patch 31.1, which just came out a few minutes ago.


Return to “SMBX-38A Bug reports”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest