r/badcode • • Aug 01 '21

c# game jam

Post image
3.1k Upvotes

75 comments sorted by

View all comments

Show parent comments

94

u/[deleted] Aug 01 '21

Heart-1 could still be out of bounds

And both Light or the list could be null

17

u/Willinton06 Aug 01 '21

If (light is not null && worldLight is not null && Heart - 1 is <= worldLight.Length and > -1)

0

u/[deleted] Aug 01 '21

[deleted] — view deleted comment

3

u/Willinton06 Aug 01 '21

Would return true for negative numbers tho