Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Fixed: Character Equipment not Drawing (1.8.x)


Recommended Posts

This is a fix for the character menu not displaying/drawing properly in ER 1.8.x (it'll be fixed in 1.9).

Go to `DrawCharacter`

Find the following code:
```
For i = 1 To count
If Player(MyIndex).Equipment(i) = 0 Then Exit Sub
textNum = Item(Player(MyIndex).Equipment(i)).Pic

With rec
.Top = 0
.Bottom = .Top + PIC_Y
.Left = 0
.Right = .Left + PIC_X
End With

With rec_pos
.Top = TextY
.Bottom = .Top + PIC_Y
.Left = TextX
.Right = .Left + PIC_X
End With

RenderTextureByRects Tex_Item(textNum), rec, rec_pos, GuiTrans

EquipmentLoc(i).X = TextX
EquipmentLoc(i).Y = TextY
EquipmentLoc(i).Width = PIC_X
EquipmentLoc(i).Height = PIC_Y

TextX = TextX + 43
Next
```

And change it to:
```
For i = 1 To count
With rec
.Top = 0
.Bottom = .Top + PIC_Y
.Left = 0
.Right = .Left + PIC_X
End With

With rec_pos
.Top = TextY
.Bottom = .Top + PIC_Y
.Left = TextX
.Right = .Left + PIC_X
End With

If Not Player(MyIndex).Equipment(i) = 0 Then
textNum = Item(Player(MyIndex).Equipment(i)).Pic
RenderTextureByRects Tex_Item(textNum), rec, rec_pos, GuiTrans
End If

EquipmentLoc(i).X = TextX
EquipmentLoc(i).Y = TextY
EquipmentLoc(i).Width = PIC_X
EquipmentLoc(i).Height = PIC_Y

TextX = TextX + 43
Next
```

***

The issue was the Exit Sub was called instead of continuing the loop, so this change will fix that.

Thanks to @Giukko for pointing out the issue to me :)
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...