diff --git a/inspect.lua b/inspect.lua index d2ecafc..145a553 100644 --- a/inspect.lua +++ b/inspect.lua @@ -75,15 +75,15 @@ replacer.inspect = function( itemstack, user, pointed_thing, mode, show_receipe text = text..'entity \"'..tostring( luaob.name )..'\"'; local sdata = luaob:get_staticdata(); if( sdata ) then - sdata = minetest.deserialize( sdata ); - if( sdata and sdata.itemstring ) then + sdata = minetest.deserialize( sdata ) or {}; + if( sdata.itemstring ) then text = text..' ['..tostring( sdata.itemstring )..']'; if( show_receipe ) then -- the fields part is used here to provide additional information about the entity replacer.inspect_show_crafting( name, sdata.itemstring, { pos=pos, luaob=luaob} ); end end - if( sdata and sdata.age ) then + if( sdata.age ) then text = text..', dropped '..tostring( math.floor( sdata.age/60 ))..' minutes ago'; end end