View Issue Details

IDProjectCategoryView StatusLast Update
0000585Gameplay + OpenGL[All Projects] Bugpublic2017-04-15 05:06
ReporterMajor Cooke 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000585: Odd Vector array access behavior
DescriptionFor some reason, using a for loop to access a Vector array procures some... very strange results.
Steps To ReproduceDownload D4D.pk3 below. Start a new game and 'give keys' in console. Notice how they're all aligned horribly.

Open up D4D.pk3 -> ZStatusBars.txt.

Uncomment lines 245 to 252, then comment out the for loop below. Run the game and give keys once more.

This time the alignment is actually correct.
TagsNo tags attached.

Relationships

Activities

Major Cooke

Major Cooke

2017-04-14 20:51

reporter  

D4D.pk3 (519,900 bytes)
_mental_

_mental_

2017-04-15 04:19

developer   ~0001381

It's definitely a codegen issue: Vector2 is a structure internally and it's handled accordingly.
If you try to run it in Debug configuration, an assertion failure will be triggered in the related code.

As a temporary solution it's possible to rewriting the loop like that will fix the problem:
for (int i = 0; i < KeyPos.Size(); i++)
{
    int keyamt = GetAmountOnly(keynames[i]);
    if (keyamt > 0)
        DrawImage(keyimg[i], (KeyPos[i].x, KeyPos[i].y), imageAlignment);		
}
Graf Zahl

Graf Zahl

2017-04-15 05:06

administrator   ~0001383

Arrays of vectors did not properly allocate VM registers, resulting in bad values being passed.

Issue History

Date Modified Username Field Change
2017-04-14 20:51 Major Cooke New Issue
2017-04-14 20:51 Major Cooke File Added: D4D.pk3
2017-04-15 04:19 _mental_ Status new => confirmed
2017-04-15 04:19 _mental_ Note Added: 0001381
2017-04-15 05:06 Graf Zahl Status confirmed => resolved
2017-04-15 05:06 Graf Zahl Resolution open => fixed
2017-04-15 05:06 Graf Zahl Note Added: 0001383