If statement not working correctly
Hi.
For my grid inventory, I work with a list x 2d-array combination. I have the mistake, that the if statement, that checks if a place in inventory is already occupied by an item, don't works correctly.
There must be a mistake in the code, but i can't get it.
The 2d-array is calculated before the if statement checks the current position of the matrix for a free place; done by this code:
Deleted -*
That works perfectly, how I can check by labeling the matrix-value for each position:
Then, the if statement checks the place, done by that:
Deleted -*
So, the mistake have to happen by the if check...
Or can someone see why that happens?
Greetings
I deleted the code, don't want to release it fully.
I wrote those parts completely new with another approach. Works now with the right finetuning. No idea what was wrong, but I saw that sometimes that scripts in unity outrun itself (not the first time).
Thx for reply...