SmallJoker [Thu, 12 Nov 2020 18:15:41 +0000 (19:15 +0100)]
PlayerSAO: Run on_player_hpchange raw change values (#10478)
The callback is only run when a change in HP is to be expected.
Following cases will not trigger the callback:
* Dead player damaged further
* Healing full-health player
* Change of 0 HP
Markus Koch [Sat, 7 Nov 2020 16:45:32 +0000 (17:45 +0100)]
Joystick: Remap joystick-specific KeyTypes to generic ones
According to the following table:
* MOUSE_L -> DIG
* MOUSE_R -> PLACE
* SCROLL_UP -> HOTBAR_NEXT
* SCROLL_DOWN -> HOTBAR_PREV
This commit entirely removes the special KeyTypes used for joysticks.
Support for the MOUSE KeyTypes had already been removed in the main
game code without adapting the joystick code, breaking joystick
input. This commit restores joystick functionality.
red-001 [Mon, 2 Nov 2020 21:21:03 +0000 (21:21 +0000)]
Block attempts to connect to the client (#10589)
A Minetest peer initiates a connection by sending a packet with an invalid peer_id, for whatever reason the code for doing this ran on both the client and the server meaning you could connect to a client if you knew what the address:port tuple it was listening on.
Lars [Sun, 18 Oct 2020 23:38:51 +0000 (16:38 -0700)]
Minor clientmap improvements.
- Avoid calculating isBlockInSight for blocks without meshes.
- Add metric for how many blocks the client has currently loaded.
- Make some variables constant.
HybridDog [Tue, 6 Oct 2020 18:49:46 +0000 (20:49 +0200)]
Add minetest.get_artificial_light and minetest.get_natural_light (#5680)
Add more detailed light detection functions, a function to get the artificial light (torches) and a function to get the sunlight as seen by the player (you can specify timeofday).
SmallJoker [Mon, 5 Oct 2020 07:07:33 +0000 (09:07 +0200)]
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.
Features:
* Define Minimap available modes (surface/radar, scale) from Lua, using player:set_minimap_modes()
* New HUD elements for displaying minimap with custom size and placing
* New minimap mode for displaying a texture instead of the map
Jordan Snelling [Sun, 4 Oct 2020 13:10:34 +0000 (14:10 +0100)]
Add First Person Attachments (#10360)
Fixes some other third person camera specific attachments.
Implements a single new flag for entities to be forced visible in first person mode.
Old mods do not need to be updated to use the new flag and are fully backwards compatible.
Elijah Duffy [Sat, 3 Oct 2020 16:38:08 +0000 (09:38 -0700)]
Lua API: Add register_on_chatcommand to SSM and CSM (#7862)
Allows catching a chatcommand call just after the command and the
parameters are parsed but before its existence is checked and before the
corresponding function is run. Returning `true` from a callback function
will prevent default handling of the command leaving mods to handle the
command manually.
(se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings.
It will avoid accidental use of serializeString() when a larger string can be expected.
This reverts 1a5b4b3 and further functions in serialize.cpp that are unused
The intend for a sane NetworkPacket/stream replacement was good, but a wrapper
class around i/ostream might be more versatile than introducing a new
vector-based serialization class.
Fix horizontal/vertical merging bug of hardware-colored framed glass (#10417)
Previously, the param2-controlled horizontal/vertical merge feature
(which was undocumented and forgotten) was always active, causing
uses of param2 other than "glasslikeliquidlevel" to affect H/V
merging.
Only respect H/V merge bits when paramtype2 = "glasslikeliquidlevel".
H/V merge bits and liquid level bits are designed to be used
simultaneously.
Fix chat/infotext overlap if many chat lines (#10399)
Moves the infotext depending on the value of the recent_chat_messages value + 2 additional lines to account for the 2 debug mode lines + 1 additional line as "buffer" for better readability if chat is full.
Erase all traces of normal "generation" from fragment shaders
Remove the "feature" from the engine and default config
Remove any leftover documentation of it
David CARLIER [Wed, 9 Sep 2020 17:12:03 +0000 (18:12 +0100)]
Darwin platform build fix (#10376)
the event header seemingly being generic with libevent thus renaming it.
openal and opengl are deprecated on newer mac os releases thus suppressing the build warnings.