Error during PIE initiation and after play once
Hi everyone, I'm having two issues that I can't solve and wanted to see if you guys could help me out.
The first issue is that when I start a new instance of the project from my MVS 2015 C++ code it throws an exception which I'm posting a screenshot
And the second Issue is that after I play the game once in PIE and stop it, if I try to play it Again it throws another exception which I'm posting a screenshot
asked May 17 '16 at 08:15 AM in C++ Programming
Thank you for sending me your project. I found that the issue is related to this line of code, which is #139 in your KingdomManager.cpp file:
Due to how the for loop is set up that this is contained in, it is resulting in the siteName string becoming extremely long with the words "Resource Field" repeating over and over. This results in an assert triggering when the name hits a certain limit, which explains this check causing an assert:
I commented out the body of the for loop that the line I mentioned above is in and I was able to PIE without an issue. I would like to explain how I found this however so hopefully you can find the next error that you run into.
Once I hit PIE and VS broke, I hit "Break" and then double-clicked the first line listed in the callstack. This took me to the check that caused the assert. After that, I noticed that the assert was checking a variable called "InName" and something about that value was why it was asserting. I then opened the "Locals" tab at the bottom right and found "InName". Looking at the value, it showed that it was repeating "Resource Field" over and over as its value. I then noticed that the assert was checking against a "Size" variable so I assumed that the problem was how large the string was. This prompted me to search for the words "Resource Field" in your code which led me to this line of code.
Hope this helps!
answered May 31 '16 at 07:16 PM
Matthew J ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here