const char *listname = luaL_checkstring(L, 2);
int newsize = luaL_checknumber(L, 3);
Inventory *inv = getinv(L, ref);
+ if(inv == NULL){
+ return 0;
+ }
if(newsize == 0){
inv->deleteList(listname);
reportInventoryChange(L, ref);
const char *listname = luaL_checkstring(L, 2);
int newwidth = luaL_checknumber(L, 3);
Inventory *inv = getinv(L, ref);
+ if(inv == NULL){
+ return 0;
+ }
InventoryList *list = inv->getList(listname);
if(list){
list->setWidth(newwidth);
InvRef *ref = checkobject(L, 1);
const char *listname = luaL_checkstring(L, 2);
Inventory *inv = getinv(L, ref);
- push_inventory_list(inv, listname, L);
+ if(inv){
+ push_inventory_list(inv, listname, L);
+ } else {
+ lua_pushnil(L);
+ }
return 1;
}
InvRef *ref = checkobject(L, 1);
const char *listname = luaL_checkstring(L, 2);
Inventory *inv = getinv(L, ref);
+ if(inv == NULL){
+ return 0;
+ }
InventoryList *list = inv->getList(listname);
if(list)
read_inventory_list(inv, listname, L, 3,