bugfix for not yet generated village inhabitants in lists

master
Sokomine 2017-07-24 19:17:01 +02:00
parent ca512ee28e
commit a918c05da3
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,9 @@ mg_villages.list_plots_formspec = function( player, formname, fields )
formspec = formspec..tostring( bpos.btype )..',';
end
if( not( bpos.beds ) or #bpos.beds<1 ) then
if( bpos.worker and bpos.worker.lives_at and bpos_list[ bpos.worker.lives_at ] ) then
if( bpos.worker and bpos.worker.lives_at and bpos_list[ bpos.worker.lives_at ]
and bpos_list[ bpos.worker.lives_at ].beds
and bpos_list[ bpos.worker.lives_at ].beds[1]) then
local btype2 = mg_villages.BUILDINGS[ bpos_list[ bpos.worker.lives_at ].btype];
local worker_plot = bpos_list[ bpos.worker.lives_at ];
formspec = formspec..'-,'..

View File

@ -99,7 +99,7 @@ end
-- (needed for determining family relationship)
mg_villages.inhabitants.mob_get_full_name = function( data, worker_data )
if( not( data ) or not( data.first_name )) then
return;
return "- unkown -";
end
local str = data.first_name;
-- if( data.mob_id ) then