Wintermute Engine Forum

Wintermute Engine => Bug reports => Fixed => Topic started by: mowren on July 30, 2008, 08:37:27 AM

Title: Checking if there are no items in inventory
Post by: mowren on July 30, 2008, 08:37:27 AM
Is there a way to check if Game.NumItems oder Game.TotalNumItems is 0/null or undefined or if the inventory is empty?
The situation is that my character doesn't have any items in his inventory and so the inventory shouldn't be available until he takes his first item (and later it I intend to make it unavailable again if all items are used or droped).

Everytime I try something like this and the condition becomes true (in other words, if there are no items in the inventory), Wintermute closes with a crash log which talks about EXCEPTION_ACCESS_VIOLATION.

Code: [Select]
var z = Game.NumItems;
if(z == 0)
{
//Do Something
}
Title: Re: Checking if there are no items in inventory
Post by: Prote1n on December 02, 2009, 02:28:28 PM
I got the same problem. I want display a message when the inventory is empty. But simply calling Game.NumItems crashes the game when its null/0
Title: Re: Checking if there are no items in inventory
Post by: Kinjal on December 11, 2009, 10:26:30 AM
Fixed. Will be released with "wme 1.9.0.1 (Kinjal Edition v1.2)".