Commit Graph

36 Commits

Author SHA1 Message Date
DS 8f085e02a1
Add metatables to lua vectors (#11039)
Add backwards-compatible metatable functions for vectors.
2021-06-04 21:22:33 +02:00
SmallJoker f46509d5e2
Remove unused functions reported by cppcheck (#10463)
Run unused functions reported by cppcheck

This change removes a few (but not all) unused functions.
Some unused helper functions were not removed due to their complexity and potential of future use.
2020-10-05 09:07:33 +02:00
sfan5 70df3d54f3 Quick workaround for crashing destructor on Mingw32
closes #10137
2020-07-09 22:01:46 +02:00
SmallJoker 42a9b45c21
Lua API: Log incorrect parameter types as error (#9954)
Incorrect parameter types are logged as errors, taking coercion into account.
This is a workaround to ensure mod compatibility.
Duplicate warnings are ignored per server instance.
2020-06-01 19:02:15 +02:00
SmallJoker be71e70a91
Script: Enforce type checks if not nil (#9748)
* Script: Enforce type checks if not nil
2020-04-27 07:02:39 +02:00
sfan5 2d5bd3bf79
scriptapi: Some small optimizations to value pushing (#9669) 2020-04-14 20:44:18 +02:00
Jordach 946c03c69b set_sky improvements, set_sun, set_moon and set_stars 2020-03-05 20:12:19 +01:00
SmallJoker cb00632e23
HTTP API: Allow binary downloads and headers (#8573)
Add minetest.features.httpfetch_binary_data
2019-06-06 19:13:29 +02:00
Loïc Blot a61e1a4dbc
Lua templating reading (part 4): s16, v2s16, v2f (#7512) 2018-07-08 23:06:33 +02:00
SmallJoker ebbd158774
c_converter: Function template for numeric fields, add v3s16 default (#7090) 2018-03-03 10:59:43 +01:00
rubenwardy 026ad912af Fix rounding error in g/set_node caused by truncation to float 2017-12-26 21:55:08 +00:00
Muhammad Rifqi Priyo Susanto a1e1a19ac3 Improvements/fixes for noise parameter input in advanced settings
Formspec input for each individual noise parameter and flag.
Allow noise flags to be set in advanced settings, previously only settable
in minetest.conf.

Standardise 'group format' for noise parameters set in minetest.conf, as
only these support noise flags. However the older 'single line' format is
still accepted to support existing minetest.conf files.
Therefore auto-generate minetest.conf.example with noise parameters in
'group format'.

Setting 'type' in settingtypes.txt is now either 'noise_params_2D' or
'noise_params_3D', the dimension number is displayed in the advanced
settings edit page.
2017-10-23 01:28:13 +01:00
Rob Blanckaert a9d43a0471 Object properties: Add 'glow', disables light's effect if negative
The 'glow' value is added to the ambient light value.
Negative 'glow' disables light's effect on object colour, for faking
self-lighting, UI-style entities, or programmatic colouring in mods.
2017-09-14 04:06:05 +01:00
Loïc Blot 1c1c97cbd1 Modernize source code: last part (#6285)
* Modernize source code: last par

* Use empty when needed
* Use emplace_back instead of push_back when needed
* For range-based loops
* Initializers fixes
* constructors, destructors default
* c++ C stl includes
2017-08-20 13:30:50 +02:00
Thomas--S e63df5ce80 Sort box corners correctly 2017-08-04 21:57:50 +02:00
sapier f5070b4454 Added lua tracebacks to some errors where you have been blind to what… (#5043)
* Added lua tracebacks to some errors where you have been blind to what actually went wrong
2017-01-15 13:36:53 +01:00
sfan5 5fd1ef9b58 Revert "Adding particle blend, glow and animation (#4705)"
This reverts commit 93e3555eae.
2016-11-14 15:28:06 +01:00
Foghrye4 93e3555eae Adding particle blend, glow and animation (#4705) 2016-11-15 00:09:59 +10:00
Foghrye4 6eb6e75fff Adding LuaError on attempt to assign vectors with values out of range 2016-10-25 21:10:51 +02:00
Tomas c013c73f33 Lua->C getintfield() use lua_tointeger (#4408)
previously function used tonumber which returned float
this caused errors in large numbers and resulted in
obj-def-handlers being invalid when retrived from lua tables in c
2016-08-10 12:17:48 +02:00
Jeija 31e0667a4a Add Lua interface to HTTPFetchRequest
This allows mods to perform both asynchronous and synchronous HTTP
requests. Mods are only granted access to HTTP APIs if either mod
security is disabled or if they are whitelisted in any of the
the secure.http_mods and secure.trusted_mods settings.

Adds httpfetch_caller_alloc_secure to generate random, non-predictable
caller IDs so that lua mods cannot spy on each others HTTP queries.
2016-02-22 15:39:41 +01:00
TeTpaAka c0335f7d13 Add some missing getter functions to the lua API
ObjectRef:
get_properties
get_armor_groups
get_animation
get_attach
get_bone_position

Players:
get_physics_override
hud_get_hotbar_itemcount
hud_get_hotbar_image
hud_get_hotbar_selected_image
get_sky
get_day_night_ratio
get_local_animation
get_eye_offset

Global:
minetest.get_gen_notify
minetest.get_noiseparams
2015-05-28 16:46:35 +02:00
kwolekr 4c9a8a91c4 SAPI/Noise: Add PerlinNoiseMap:getMapSlice() function
This adds the ability to grab 'slices' of noise calculated by PerlinNoiseMap.
Retrieving smaller slices of noise from the computation result as needed
optimizes memory usage while maintaining a reasonable amount of CPU overhead.
2015-05-17 04:04:17 -04:00
kwolekr fb36c471d7 SAPI: Accept either ARGB8 table or ColorString to specify colors 2015-05-16 20:15:03 -04:00
TeTpaAka 19cbb6b37b Add push_ARGB8 to script/common/c_converter 2015-05-15 16:21:56 -04:00
kwolekr 2b99d904f6 Schematics: Add per-node force placement option 2015-05-09 18:44:00 -04:00
kwolekr 0e64fc45b9 Fix missing Y component assignment in check_v3f 2015-05-08 00:03:41 -04:00
Kevin Ott e17c6ba2cd Remove duplicate lua_getfield() in c_converter.cpp
Fixes #2678
2015-05-07 09:57:34 +02:00
ShadowNinja 3a8e7341ec Fix error messages for type-checking Lua reading functions 2015-05-06 15:33:36 -04:00
kwolekr 3d4244cc75 Add 'persistence' alias for Lua noiseparams and validate more vector parameters 2015-04-19 21:42:40 -04:00
kwolekr 479f38973e Schematics: Refactor NodeResolver and add NodeResolveMethod
NodeResolver name lists now belong to the NodeResolver object instead of
the associated NodeDefManager.  In addition to minimizing unnecessary
abstraction and overhead, this move permits NodeResolvers to look up nodes
that they had previously set pending for resolution.  So far, this
functionality has been used in the case of schematics for
serialization/deserialization.
2015-04-16 16:27:05 -04:00
kwolekr b67f37f27e Redefine NodeResolver interface and replace with callback mechanism 2014-12-27 02:12:21 -05:00
kwolekr d274cbfce6 Add NodeResolver and clean up node name -> content ID resolution system 2014-10-26 23:55:45 -04:00
BlockMen 8b02a015eb Use integers instead of float values 2014-04-12 20:04:12 +02:00
sapier b1ef850877 Fix possible 0 pointer access 2013-07-02 20:01:48 -04:00
sapier ab43377577 Move scriptapi to separate folder (by sapier)
On the lua side, notably minetest.env:<function>(<args>) should now
be replaced by minetest.<function>(<args>).
The old way is and will stay supported for a long time.

Also:
Update and clean up lua_api.txt (by celeron55)
Move EnvRef to lua and remove add_rat and add_firefly (by kahrl)
Add separate src/util/CMakeLists.txt, other minor fixes (by kahrl)
2013-05-25 00:51:02 +02:00