mesecons icon indicating copy to clipboard operation
mesecons copied to clipboard

Add all safe helper function from lua_api.txt

Open Lejo1 opened this issue 4 years ago • 2 comments

Includes #500 Just need to be checked if there are any needing an safe implementation(Didn't found any).

PS: Can I do for math and table also just like for vector math = math? Do I need to list them all separately?

Discussion: Shall I implement get_us_time? There are extra blocks in mesecons + diglines to get the time so they would get useless...

Lejo1 avatar Mar 30 '20 11:03 Lejo1

Would vector = table.copy(vector) work? EDIT: Tested it, worked!

Am 30.03.2020 um 13:39 schrieb DS [email protected]:

 @Desour commented on this pull request.

In mesecons_luacontroller/init.lua:

  •   minetest = {
    
  • 	wrap_text = minetest.wrap_text,
    
  • 	pos_to_string = minetest.pos_to_string,
    
  • 	string_to_pos = minetest.string_to_pos,
    
  • 	string_to_area = minetest.string_to_area,
    
  • 	formspec_escape = minetest.formspec_escape,
    
  • 	is_yes = minetest.is_yes,
    
  • 	is_nan = minetest.is_nan,
    
  • 	get_us_time = minetest.get_us_time,
    
  • 	parse_json = minetest.parse_json,
    
  • 	write_json = minetest.write_json,
    
  • 	rgba = minetest.rgba,
    
  • 	encode_base64 = minetest.encode_base64,
    
  • 	decode_base64 = minetest.decode_base64,
    
  • },
    
  • vector = vector,
    

Can I do for math and table also just like for vector math = math? Do I need to list them all separately?

If you do this, the player can modify the vector table. This here is not a deep copy, you just copy the reference.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Lejo1 avatar Mar 30 '20 11:03 Lejo1

Is it possible to allow nonplain string.format for the dump and wrap_text function?

Lejo1 avatar Mar 30 '20 12:03 Lejo1