@@ -76,7 +76,7 @@ ItemDefinition read_item_definition(lua_State* L,int index,
76
76
getboolfield (L, index , " liquids_pointable" , def.liquids_pointable );
77
77
78
78
warn_if_field_exists (L, index , " tool_digging_properties" ,
79
- " deprecated: use tool_capabilities" );
79
+ " Deprecated; use tool_capabilities" );
80
80
81
81
lua_getfield (L, index , " tool_capabilities" );
82
82
if (lua_istable (L, -1 )){
@@ -427,17 +427,17 @@ ContentFeatures read_content_features(lua_State *L, int index)
427
427
428
428
// Warn about some deprecated fields
429
429
warn_if_field_exists (L, index , " wall_mounted" ,
430
- " deprecated: use paramtype2 = 'wallmounted'" );
430
+ " Deprecated; use paramtype2 = 'wallmounted'" );
431
431
warn_if_field_exists (L, index , " light_propagates" ,
432
- " deprecated: determined from paramtype" );
432
+ " Deprecated; determined from paramtype" );
433
433
warn_if_field_exists (L, index , " dug_item" ,
434
- " deprecated: use 'drop' field" );
434
+ " Deprecated; use 'drop' field" );
435
435
warn_if_field_exists (L, index , " extra_dug_item" ,
436
- " deprecated: use 'drop' field" );
436
+ " Deprecated; use 'drop' field" );
437
437
warn_if_field_exists (L, index , " extra_dug_item_rarity" ,
438
- " deprecated: use 'drop' field" );
438
+ " Deprecated; use 'drop' field" );
439
439
warn_if_field_exists (L, index , " metadata_name" ,
440
- " deprecated: use on_add and metadata callbacks" );
440
+ " Deprecated; use on_add and metadata callbacks" );
441
441
442
442
// True for all ground-like things like stone and mud, false for eg. trees
443
443
getboolfield (L, index , " is_ground_content" , f.is_ground_content );
@@ -639,14 +639,13 @@ void pushnode(lua_State *L, const MapNode &n, INodeDefManager *ndef)
639
639
640
640
/* *****************************************************************************/
641
641
void warn_if_field_exists (lua_State *L, int table,
642
- const char *fieldname , const std::string &message)
642
+ const char *name , const std::string &message)
643
643
{
644
- lua_getfield (L, table, fieldname);
645
- if (!lua_isnil (L, -1 )){
646
- // TODO find way to access backtrace fct from here
647
- // infostream<<script_get_backtrace(L)<<std::endl;
648
- infostream<<" WARNING: field \" " <<fieldname<<" \" : "
649
- <<message<<std::endl;
644
+ lua_getfield (L, table, name);
645
+ if (!lua_isnil (L, -1 )) {
646
+ warningstream << " Field \" " << name << " \" : "
647
+ << message << std::endl;
648
+ infostream << script_get_backtrace (L) << std::endl;
650
649
}
651
650
lua_pop (L, 1 );
652
651
}
@@ -705,7 +704,7 @@ ItemStack read_item(lua_State* L, int index,Server* srv)
705
704
}
706
705
catch (SerializationError &e)
707
706
{
708
- infostream <<" WARNING: unable to create item from itemstring"
707
+ warningstream <<" unable to create item from itemstring"
709
708
<<" : " <<itemstring<<std::endl;
710
709
return ItemStack ();
711
710
}
@@ -840,14 +839,14 @@ ToolCapabilities read_tool_capabilities(
840
839
getintfield (L, table_groupcap, " uses" , groupcap.uses );
841
840
// DEPRECATED: maxwear
842
841
float maxwear = 0 ;
843
- if (getfloatfield (L, table_groupcap, " maxwear" , maxwear)){
844
- if (maxwear != 0 )
842
+ if (getfloatfield (L, table_groupcap, " maxwear" , maxwear)){
843
+ if (maxwear != 0 )
845
844
groupcap.uses = 1.0 /maxwear;
846
845
else
847
846
groupcap.uses = 0 ;
848
- infostream<< script_get_backtrace (L)<<std::endl;
849
- infostream<< " WARNING: field \" maxwear\" is deprecated; "
850
- << " should replace with uses=1/maxwear " << std::endl;
847
+ warningstream << " Field \" maxwear \" is deprecated; "
848
+ << " replace with uses=1/ maxwear" << std::endl;
849
+ infostream << script_get_backtrace (L) << std::endl;
851
850
}
852
851
// Read "times" table
853
852
lua_getfield (L, table_groupcap, " times" );
0 commit comments