About Store Forum Documentation Contact
Donations:
140$/mo



Post Reply 
i-value issues with latest update VS2019
Author Message
Dwight Offline
Silver Supporter

Post: #1
i-value issues with latest update VS2019
Hi all,

When rebuilding the MMO source code, I get the following errors on the following 2 lines after the latest VS2019 update 16.8.2:

Code:
if(region)region.virtualSize(&Vec2(0, y));
ctrl.create(Capsule(0.3, h), &Vec(0, -h/2, 0)).actor.kinematic(true).collision(false).obj(this);

Error: error C2102: '&' requires l-value.

I know that the address-of operator ( & ) must have an l-value as operand. [Microsoft doc: https://docs.microsoft.com/en-us/cpp/err...w=msvc-160 ]

What would be the easiest way of fixing this? Create a new variable, assign it and voila? Or is there something else under the hood going on here?
11-23-2020 06:17 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #2
RE: i-value issues with latest update VS2019
You're passing a r-value by sending

Code:
&Vec2(0, y)


as an argument. Without testing, I believe the fix would be to make it an l-value, so declare it as a variable on the line above:
Code:
Vec2 size = Vec2(0, y);
region.virtualSize(&size);

I think that would fix it. I am not sure why we'd have to pass the argument as a const pointer. To me, it makes more sense to use a const reference, but perhaps Esenthel could explain the reasoning.
11-23-2020 06:40 PM
Find all posts by this user Quote this message in a reply
Dwight Offline
Silver Supporter

Post: #3
RE: i-value issues with latest update VS2019
(11-23-2020 06:40 PM)Tottel Wrote:  You're passing a r-value by sending

Code:
&Vec2(0, y)


as an argument. Without testing, I believe the fix would be to make it an l-value, so declare it as a variable on the line above:
Code:
Vec2 size = Vec2(0, y);
region.virtualSize(&size);

I think that would fix it. I am not sure why we'd have to pass the argument as a const pointer. To me, it makes more sense to use a const reference, but perhaps Esenthel could explain the reasoning.

Hi Tottel,

Great to see you get active more here! grin

That indeed solved it, so it must be a new update in the language! "Create a new variable, assign it and voila?"
11-23-2020 06:48 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #4
RE: i-value issues with latest update VS2019
Glad to hear that solved it grin
I've never stopped lurking here and I was still working on Esenthel projects. Sadly, the PBR update broke all of the assets I had made over the years, and I realized I had NO SOURCE FILES WHATSOEVER anymore. I couldn't fix the texture issues. So yeah, that was a bummer and I gave up on those projects..
11-23-2020 09:07 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: i-value issues with latest update VS2019
@Dwight: Thank you for reporting this! I will investigate once I finish my current tasks.
@Tottel: Sorry to hear that, I recommend using OneDrive, Google Drive, Mega, DropBox to store various asset source files for backup.
11-25-2020 05:20 AM
Find all posts by this user Quote this message in a reply
Dwight Offline
Silver Supporter

Post: #6
RE: i-value issues with latest update VS2019
(11-23-2020 09:07 PM)Tottel Wrote:  Glad to hear that solved it grin
I've never stopped lurking here and I was still working on Esenthel projects. Sadly, the PBR update broke all of the assets I had made over the years, and I realized I had NO SOURCE FILES WHATSOEVER anymore. I couldn't fix the texture issues. So yeah, that was a bummer and I gave up on those projects..

No reason to not start over. If there's 1 thing I learned this year with all the things going on, it's that with the increase in free time I get to spend more time studying and enjoying working on my project. Finally having the time to spend 2 hours a day learning how to code is such a game changer, and that is something none can take away from you.

Now go code those projects. I expect more nice projects in the Esenthel store from you to digest and learn from. Use placeholder assets! grin

And #SubscribeToEsenthel.
(This post was last modified: 11-25-2020 12:26 PM by Dwight.)
11-25-2020 12:26 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
RE: i-value issues with latest update VS2019
Another way to solve this is to do:
region.virtualSize(&NoTemp(Vec2(0, y)));

I've reported the problem to Microsoft and will see what they reply.
11-29-2020 08:30 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #8
RE: i-value issues with latest update VS2019
12-07-2020 02:17 PM
Find all posts by this user Quote this message in a reply
Post Reply