Commit Graph

87 Commits

Author SHA1 Message Date
rubenwardy 94296a9d2a
Builtin: Add vector.floor helper function 2022-05-21 16:13:56 +02:00
HybridDog 6cbe7ef399
Only allow strings to be passed to minetest.global_exists (#4253)
Sometimes you accidentally forget the quotes when using global_exists, this makes minetest abort if you did so.

M  builtin/common/strict.lua
2022-05-21 16:13:43 +02:00
Rui914 32752d2bc5
Faster insertion into table 2022-05-21 16:13:23 +02:00
ShadowNinja 8fc9b3b9cb
Refactor logging
- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
2022-05-21 16:12:54 +02:00
kwolekr 37a94ffa9d
Add /emergeblocks command and core.emerge_area() Lua API 2022-05-21 16:12:52 +02:00
sfan5 22c20ffd4d
Allow random menu images for subgames 2022-05-21 16:12:43 +02:00
est31 fea38f3780
Fix wrong replace from previous commit 2022-05-21 16:12:34 +02:00
est31 1c971d206e
Localize inside whole misc_helpers.lua 2022-05-21 16:12:34 +02:00
ShadowNinja 6e61c7d92a
Add minetest.global_exists() 2022-05-21 16:12:30 +02:00
ShadowNinja 53f255dbc9
Fix serialization of floating point numbers 2022-05-21 16:12:26 +02:00
est31 5a662882bf
Server: announce MIN/MAX protocol version supported to serverlist. Client: check serverlist
Client now informs about incompatible servers from the list, this permits to prevent the protocol movements.
Server announces its supported protocol versions to master server
2022-05-21 16:12:25 +02:00
est31 1052201620
Fix crash on passing false as value in table to table.copy(t)
Fixes #2293.
2022-05-21 16:12:23 +02:00
rubenwardy bd42a0c92e
Change assignment to global in a function to warning 2022-05-21 16:12:20 +02:00
ShadowNinja 32911a2064
Fix imprecise serialization of large numbers 2022-05-21 16:12:19 +02:00
kwolekr 5d9c758b13
Simplify deleteblocks chat command argument parsing
Add optional core.pos_to_string decimal place rounding
Move core.string_to_pos to builtin/common/misc_helpers.lua for consistency
2022-05-21 16:12:17 +02:00
Diego Martínez d6acaced3f
Fix typo in `serialize.lua`. 2022-05-21 16:12:17 +02:00
Diego Martínez c2450727a1
Fix off-by-one error in `string:split` implementation. 2022-05-21 16:12:13 +02:00
Diego Martínez a88e2f410b
Faster string.split implementation. 2022-05-21 16:12:11 +02:00
Zeno- 64bc547162
Revert "Adjust the values of dirs1 and dirs2 so that rotate_and_place orients textures correctly"
This reverts commit 9878e8de4fdf232ebb77b396766c339786c01218.

See: https://github.com/minetest/minetest/issues/1939 and IRC log for discussion
2022-05-21 16:12:09 +02:00
paramat 1adec0e3c5
Fix undeclared globals in functions and shorten lines in misc_helpers.lua. 2022-05-21 16:12:08 +02:00
SmallJoker 2dba3fd295
Add Lua helper functions vector.apply(v) math.sign(x, tolerance) 2022-05-21 16:12:07 +02:00
SmallJoker 7fa045415f
Add minetest.copy_table(table) To get rid off the "table references"
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2022-05-21 16:12:06 +02:00
dvere 694e0d0781
Adjust the values of dirs1 and dirs2 so that rotate_and_place orients textures correctly
According to doc/lua_api.txt if paramtype2 == "facedir" the two least significant bits of parm2 orient the texture around the axis. For dirs1 (looking at a wall) these would be 0, 1, 2, 3 and for dirs2 (looking at the ceiling) 2, 1, 0, 3
2022-05-21 16:12:05 +02:00
ShadowNinja 4bc849b059
Make duplicate warning checks file and line specific 2022-05-21 16:12:04 +02:00
sapier 7b55a9a5cd
Fix console spaming by debug function on mod checking for global variable to exist. 2022-05-21 16:12:04 +02:00
ShadowNinja adf3454250
Add strict module
Also fix leaking globals found by it.
2022-05-21 16:12:02 +02:00
ShadowNinja 5805e555cf
Tweak core.serialize
This adds proper support for nested tables and improves performance a bit.
2022-05-21 16:12:02 +02:00
ShadowNinja d9875f12f2
Fix dump() indentation with non-tab indents 2022-05-21 16:12:00 +02:00
Ryan Newell c8a29cc3b7
Add last_login field to auth.txt
Also shortens some related code and adds more parameters to string.split.
2022-05-21 16:12:00 +02:00
ShadowNinja f32731396b
Make dump's output prettier
Changes:
  * Indentation with tabs by default.
  * Array keys dumped without "[i] = " prefix.
  * String keys that are valid identifiers aren't enclosed in '[""]'.
  * Basic support for multiple references (as specified in the comment).
2022-05-21 16:11:57 +02:00
ShadowNinja 21f38e1fcb
Remove vector assertions
These were initially added to get tracebacks for invalid vector errors, but it
didn't work and tracebacks have since been properly fixed in the core.
2022-05-21 16:11:53 +02:00
sapier dd0e0e019f
Add srollbar formspec element 2022-05-21 16:11:52 +02:00
ShadowNinja 3164569a22
Rework dumping functions
Changes:
  * Add comments to explain the dumping code
  * Add support for dumping values of any type (as '<' <type> '>')
  * Add support for tables as keys in dump2()
  * Make dump2() return it's result (like dump()) rather than printing it
  * Simplify and optimize function serialization via serialize()
2022-05-21 16:11:44 +02:00
sapier bb671de29d
Fix a bunch of small bugs due to mainmenu cleanup Fix doubleclick not working in singleplayer Fix of by one issue on accessing raw list Fix this->self Fix copy&paste error for scroll button 2022-05-21 16:11:44 +02:00
sapier c2df20263f
Add formspec toolkit and refactor mainmenu to use it Fix crash on using cursor keys in client menu without selected server Add support for non fixed size tabviews 2022-05-21 16:11:42 +02:00
ShadowNinja 37c32c715f
Use "core" namespace internally 2022-05-21 16:11:41 +02:00
ShadowNinja 148b74312e
Organize builtin into subdirectories 2022-05-21 16:11:40 +02:00