Commit Graph

5674 Commits

Author SHA1 Message Date
Lars Hofhansl
8d629cf65b Fix bug setting channel window size. 2018-07-13 05:02:08 -07:00
Lars Hofhansl
93c0b3b8fb Ensure that legacy mode is correctly disabled. 2018-07-13 02:50:01 -07:00
Lars Hofhansl
ba7cf30df9 Reduce block load glitches
See #7542
This reduces glitches in deep water and underground caves.
2018-07-12 00:54:00 -07:00
Muhammad Rifqi Priyo Susanto
7ebc229b0d Android: Add 'aux' button (#7477)
Add 'aux' button.
Use joystick to trigger 'aux' button when forward and out of main circle, by enabling
'virtual_joystick_triggers_aux' setting.
2018-07-10 23:33:40 +01:00
SmallJoker
f7a8e75765 Formspecs: Remove accidental empty 'quit' field 2018-07-10 18:27:03 +02:00
Loïc Blot
a61e1a4dbc
Lua templating reading (part 4): s16, v2s16, v2f (#7512) 2018-07-08 23:06:33 +02:00
lhofhansl
94cd2bfeac Revert 6587 - Optimize entity-entity collision (#7539) 2018-07-08 21:30:55 +01:00
HybridDog
53dd781927 Fix memory leak in guiConfirmRegistration 2018-07-06 11:13:18 +02:00
lhofhansl
03edcafdda Zoom: Correctly verify client passed zoom at the server (#7526)
Fixes generation of distant world when not zooming in creative mode
(in creative mode zoom FOV is 15 degrees).
2018-07-03 00:16:17 +01:00
Loic Blot
1ff15d3a46
Drop ClientEvent CEE_PLAYER_BREATH: triggering function is not called.
Also drop 3 useless IntervalLimiter
2018-07-01 13:47:57 +02:00
SmallJoker
49509d2f74
Log deprecated Lua function calls (#7491) 2018-07-01 12:31:49 +02:00
SmallJoker
6f22d14206
Make the server status message customizable (#7357)
Remove now redundant setting show_statusline_on_connect
Improve documentation of `minetest.get_server_status`
2018-07-01 12:31:28 +02:00
Muhammad Rifqi Priyo Susanto
ad3d1d20d1 Android: Resize jump and sneak buttons' touch target (#7498) 2018-06-30 22:33:14 +01:00
Loïc Blot
eef62c82a2
Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* Modernize lua read (part 2 & 3): C++ templating assurance

Implement the boolean reader
Implement the string reader
Also remove unused & unimplemented script_error_handler
Add a reader with default value
2018-06-30 17:11:38 +02:00
red-001
227c71eb76 Fix memory leaks in mod storage (#7500) 2018-06-30 17:11:04 +02:00
Vitaliy
9f19b7d936 Fix world deletion (#7494)
* Fix world deletion
2018-06-30 15:13:53 +02:00
Loic Blot
d7f873bc8d
Fix a memleak before assertion in l_get_mod_storage 2018-06-30 10:32:02 +02:00
red-001
e36af6f969 Fix mod channels crash (#7481) 2018-06-27 17:45:40 +02:00
red-001
a43a4e2d97 Fix small memory leaks in client. (#7492) 2018-06-27 17:06:37 +02:00
Paramat
93661ca212
Cavegen: Fix errors when getting biome outside mapchunk (#7480)
Some cave segments are outside the mapchunk.

Previously, biome was being calculated by a function that uses the noise
maps. Points outside the mapchunk resulted in incorrect noise map indexes
that were sometimes outside the noise map size, causing a crash.

Use either noise maps or point noise calculations depending on point
location.
2018-06-26 19:35:23 +01:00
SmallJoker
b589352e79 Update settings translations 2018-06-26 15:38:42 +02:00
SmallJoker
db42542e27 Rename CSM flavours to restrictions
& Satisfy LINT
2018-06-26 15:38:42 +02:00
red-001
7bdf5eae05 Fix buffer overrun in SRP (#7484)
The old code got a pointer to the array instead of the first element, this resulted in a buffer overflow when the function was used more than once.
2018-06-26 10:02:26 +02:00
sfan5
b298b0339c Fix MurmurHash implementation to really be unaligned (#7482) 2018-06-26 00:12:09 +01:00
Paramat
de621d5d4b
Decoration API: Add lightweight ability to have complete coverage (#7456)
When the noise value or fill_ratio >= 10.0 complete coverage is enabled.
This disables random placement to avoid redundant multiple placements
at one position. Instead, 1 decoration per surface node is placed by
looping across each division.

'10' was chosen as this is the fill_ratio that previously created
very near complete coverage. The complete coverage feature therefore
integrates smoothly when noise is used for variable decoration density.

'fill_ratio = 10' should be used by modders who want a decoration
placed on every surface node. Compared to before such a decoration
placement will be 10 times faster.
2018-06-24 17:14:18 +01:00
SmallJoker
1d1cf000c0 Fix rtt >= 0.0f assertion and free_move crash 2018-06-24 14:48:19 +02:00
stujones11
6b72d8d090 Android: Use correct temporary path (#7463) 2018-06-23 22:38:19 +02:00
you
968ce9af59 RTT fixes (#7428)
* Few code updates

* Do not show average RTT before timing out

* Fix unwanted integer division in RTTStatistics

* Fix float format, prettier jitter calculation

* Use +=, 0.1f -> 100.0f for stronger average updates
2018-06-23 09:16:01 +02:00
red-001
07b1743d3d Fix crash caused by Lua error during startup (#7473) 2018-06-22 21:04:41 +02:00
sfan5
c66d977269 Fix ipv6_server=true not accepting IPv4 connections on Windows (#7471) 2018-06-22 20:54:23 +02:00
Paramat
8d3190e77a
Biome API: Fix absent water decorations and dust, in deep water (#7470)
Previously, the biomemap was 'BIOME_NONE' for a mapchunk column if a
stone surface was not found in it, causing water surface decorations
and water surface dust to fail.

Store the biome ID of the biome calculated at a water surface and add
it to the biomemap if the biomemap is 'BIOME_NONE' for the mapchunk
column. The biome calculated at a stone surface still has priority
for the biomemap entry, as it should.

Edit an incorrect comment.
2018-06-21 19:28:54 +01:00
Paramat
86389329eb
Biome dust: Revert fix that added dust to mod structures (#7464)
Revert commit 99143f494711034068685b6ee845ce19fa09d7d9 and commit
f4ca830abe1aa22875c99b31bf2ee56e26f83f05.

These commits caused biome dust to be applied even when there was no core
mapgen terrain in a mapchunk column. So the dust, which overgenerates,
then appeared on structures added by mods in 'on_generated', such as
floatlands, asteroids or above-surface realms.
2018-06-19 22:09:42 +01:00
rubenwardy
ca502fc274
Update to new ContentDB API 2018-06-18 20:47:38 +01:00
thoughtjigs
3d516079eb Provide Xorg/net wm process ID (#7445)
Adding support for _NET_WM_PID as defined in Extended Window Manager Hints
Move verbose messaging to setupXorgTopLevelWindow method as Xorg messages should only occur when running in Xorg env.
Irrlicht returns the XDisplay as a void* and XWindow as an unsigned long so reinterpret those as the appropriate type. Also fixed a spaces for tab formating issue
2018-06-17 10:41:07 +02:00
Loic Blot
2bec28f462
Remove Server::m_ignore_map_edit_events (noop) 2018-06-15 08:41:50 +02:00
Loïc Blot
9a1d3584c2
Server: move shutdown parts to a specific shutdown state object (#7437)
* Server: move shutdown parts to a specific shutdown state object
2018-06-13 21:58:34 +02:00
SmallJoker
409d04324f Fix the /shutdown command (#7431) 2018-06-11 13:43:12 +02:00
number Zero
2c0d8b25dd Fix narrow/utf8 difference in incoming/outcoming messages 2018-06-10 10:33:53 +02:00
Paramat
0b23253447
Mapgen flags: Add 'biomes' global mapgen flag (#7355)
Previously the only way to disable biomes was to 'clear' the registered
biomes in a mod, but this method causes large amounts of unnecessary
processing:
1. Calculation of 4 2D noises.
2. Looping through all nodes of a mapchunk replacing nodes with identical
nodes.
The new flag disables those operations.
2018-06-08 23:24:36 +01:00
tukkek
9f8582dcdf Stop autoforward on BACKWARD key-press (#7417) 2018-06-06 14:31:34 +02:00
Loïc Blot
ccc3af128c
CSM/SSM: Add on_mods_loaded callback (#7411)
* CSM/SSM: Add on_mods_loaded callback
2018-06-06 12:53:59 +02:00
Wuzzy
35bc3e2f17 Set ENABLE_GETTEXT to TRUE by default (#7415) 2018-06-05 23:02:14 +02:00
Loïc Blot
180e551c56
Modernize lua read (part 1): C++ templating insurance (#7394)
* Modernize lua read (part 1): C++ templating assurance

Implement the float reader
2018-06-04 22:38:07 +02:00
Paramat
86b19f2849
Biome dust placement: Improve comments, re-order some lines 2018-06-04 00:39:10 +01:00
Paramat
f4ca830abe
Biomemap: Simplify code of recent commit (#7398) 2018-06-02 21:28:26 +01:00
Paramat
99143f4947
Biomemap: Avoid empty biomemap entry to fix failing biome dust (#7393)
'generateBiomes()' constructs the biomemap as it generates biomes.
The biome calculated at first stone surface encountered is added to
the biomemap.
Previously, if no stone surface was encountered in a mapchunk column
the biomemap was left empty for that (x, z) position, causing biome
dust and water surface decoration placement to fail.

If at the base of a mapchunk column the biomemap is empty, add the
currently active biome to the biomemap, or if biome is NULL calculate
it for this position and add it to the biomemap.
2018-06-02 03:20:09 +01:00
Loïc Blot
162ffd7fba
Fix isNan on setYaw Lua call (#7380)
* Fix isNan on setYaw Lua call
2018-05-31 22:52:08 +02:00
Paramat
df991edaa8
Mgv7: Avoid rivergen removing mod-placed nodes when overgenerating (#7388)
Only allow river generation to replace c_stone.
This also acts as an optimisation by being placed before canyon shape
calculation.
2018-05-31 03:06:55 +01:00
Loic Blot
e3e98f9356
LINT fix 2018-05-29 22:22:14 +02:00
Wuzzy
19df59f844 Rename some keys for clarity (#7384) 2018-05-29 18:39:37 +02:00
otdav33
3f0720e721 Add crossview support (#7361) 2018-05-29 18:38:58 +02:00
Loic Blot
75aa41c6de
Fix GameUI flag value regression introduced by a78659ed0529226ad937f5e241ad72ba93702959
Added more strong unittests on that part to prevent future regression
2018-05-29 08:34:09 +02:00
Midgard
67ed56be3b Print error when HOME is not set (#7376)
In some configurations, such as when using the runit supervisor and its
tool chpst, the HOME variable might be unset. This resulted in an
unclear error message that was hard to pin down.
2018-05-28 18:00:42 +02:00
Loïc Blot
a78659ed05 Fix more GCC 8.1 warnings   1   master
Fix 3 warnings reported by GCC 8.1 of the following type

```src/client/gameui.cpp:191:43: warning: « void* memset(void*, int, size_t) » effacement d'un objet du type non trivial « struct GameUI::Flags »; use assignment or value-initialization instead [-Wclass-memaccess]
  memset(&m_flags, 0, sizeof(GameUI::Flags));
```
2018-05-28 15:39:04 +02:00
Loïc Blot
b620f2f02d Fix a -Wcatch-value warning reported by GCC 8.1
```
src/translation.cpp:43:16: warning: interception du type polymorphique « class std::out_of_range » par valeur [-Wcatch-value=]
  } catch (std::out_of_range) {
```·
2018-05-28 14:17:19 +02:00
Loic Blot
a363a9bf71
Remove a useless struct keyword for ObjectProperties 2018-05-28 08:54:57 +02:00
SmallJoker
bb4f0fd228 Formspec verification: Fix show_formspec inside callbacks (#7374) 2018-05-26 12:50:44 +02:00
Paramat
5c1edc58ab
Vein ore: Fix bug caused by changing perlinmap Y size (#7371)
Because vein ore uses 3D noise (all the other ores use 2D noise) the
perlinmap Y size can be different in different mapchunks when close
to the ore Y limits.
Previously this caused bugs in the vein structure because changes in
perlinmap Y size did not recreate the noise objects.

Delete and recreate the noise objects with the new Y size if Y size
has changed.
2018-05-24 22:20:06 +01:00
Paramat
d6a6d3176e
Schematic decorations: Fix placement bug when centred and rotated (#7365)
Previously, the centering caused by the 'place center x/z' flags did
not take rotation into account. So schematics with unequal X and Z
dimensions were incorrectly placed. The bug was hidden for schematics
equal in X and Z dimensions.
2018-05-24 02:52:35 +01:00
Paramat
53d5b3ea40
Dungeons: Fix duplication of y limit parameters (#7359) 2018-05-20 23:45:53 +01:00
you
22df02d25b Fix missing ignore textures (#7326) 2018-05-20 14:51:50 +02:00
rubenwardy
122eed7a34
Add screenshots to online content browser 2018-05-20 00:25:17 +01:00
nanoproject
8295f9f89b Player marker on both minimaps (#7350) 2018-05-18 22:45:14 +02:00
rubenwardy
3eb363f813
Add updating to online content browser 2018-05-16 21:52:12 +01:00
Lars Hofhansl
a1868e8f6c Use server's zoom fov for distant world loading. 2018-05-15 18:49:11 -07:00
Muhammad Rifqi Priyo Susanto
2f34797c5c Don't show Android edit dialog when tapping read-only field (#7337)
* Don't show Android edit dialog when tapping read-only field

From Lua API, "If the name is empty the textarea is readonly."
2018-05-15 16:13:30 +02:00
SmallJoker
a1598e1b83 Fix segfault in player migration and crash in log_deprecated
Makes log_deprecated work when triggered from no function
2018-05-14 21:19:52 +02:00
Paramat
a01a9ca24c
Vertical biome blend: Tune PRNG seed for finer detail (#7329) 2018-05-14 19:01:58 +01:00
lhofhansl
0cecc1d1a9 Make sure color returns to normal after a damage flash (#7332) 2018-05-14 12:03:39 +02:00
rubenwardy
9cc341e91f
Update contentdb_url to content.minetest.net 2018-05-13 21:41:02 +01:00
SmallJoker
d5d248ccbd
Camera: Improve subpixel movement (#7319) 2018-05-12 14:30:52 +02:00
SmallJoker
9dd432c29f Run detach callbacks on player leave
Correct docs regarding non-nil detaching children
2018-05-12 11:50:04 +02:00
Vincent Glize
a292d19fd0 Fix crash guiConfirmRegistration quit menu (#7313) 2018-05-10 13:50:06 +02:00
Paramat
4ccd18d5ec
Mgv7: Code cleanup (#7299) 2018-05-07 03:31:55 +01:00
SmallJoker
d99a033fd6
Fix builtin inventory list crash when size = 0 (#7297) 2018-05-05 22:37:07 +02:00
Paramat
21c720755b
Cavegen: Allow small RandomWalk caves to generate beyond mapchunk border 2018-05-04 18:22:56 +01:00
Vincent Glize
24b6bd0f67 Fix invisible chat error messages (#7289) 2018-05-01 19:38:37 +02:00
Kuma_jjw
55bb1938c1 nodedef: Delete two unused method definitions (#7288) 2018-04-30 19:15:11 +02:00
JDCodeIt
5862d9e482 Global new() or grab() to be managed in constuctor only (#7235 partial) (#7236)
* g_extrusion_mesh_cache new() and grab() to be managed in constuctor only (#7235 partial)

This global was getting grab()-ed by each call to getItemMesh, incrementing its reference count. What was to be the final drop() in the destructor ended up with > 0 reference count, so memory not freed by Irrlicht.
2018-04-30 19:14:28 +02:00
SmallJoker
ba91624d8c
Allow damage for attached objects, add attach/detach callbacks (#6786)
* Allow right-clicking on attached LuaEntities
2018-04-30 18:43:49 +02:00
rubenwardy
0b5b32b026 MetaDataRef: Add contains() and get() (#7214) 2018-04-30 18:42:51 +02:00
Paramat
54606e103d
Mapgen caves: Re-order generation to fix cavern bug
Previously, caverns confused tunnel generation causing biome top and filler
nodes to appear in caverns.
Split 'generateCaves()' into 2 functions to separate tunnel and large
randomwalk cave generation.
In each mapgen re-order cave generation to generate tunnels before caverns.
2018-04-29 07:20:46 +01:00
paramat
bb3baef30f Biome-defined cave liquids: Use faster biome calculation 2018-04-26 17:28:37 +02:00
paramat
9d7335a99c Biome-defined dungeon nodes: Use faster biome calculation 2018-04-26 17:27:06 +02:00
Paramat
454f80a0f7
Dungeons: Mostly fix missing stair nodes 2018-04-25 00:44:49 +01:00
Paramat
534971ccd0
Mgvalleys: Code cleanup
Split some long lines.
Edit comments.
Remove unnecessary comments and unnecessary commented-out code.
Use std::fmax/fmin instead of MYMAX/MYMIN.
Remove scope-limiting braces.
Consistently define literals as floats, except in noise parameters.
Cleanup literals in noise parameters.
Remove unnecessary 'near_cavern' line.
Reduce max spawn y to be consistent with other mapgens.
2018-04-24 01:34:48 +01:00
rubenwardy
06dd7c051c Move ASCII art to std::cerr, to remove it from logs 2018-04-23 23:04:20 +01:00
Thomas--S
9577a4396a Formspecs: Allow setting alpha value for the box[] element 2018-04-23 18:50:50 +01:00
Paramat
12a8f8826d
Mgvalleys: Use shared tunnel / cavern code instead of internal
Caverns first appeared in mgvalleys and were later added to other
mapgens as shared code. Now this shared code can replace mgvalley's
internal cavern code.
Also use shared tunnel code instead of internal code.

Changes to mapgen that will affect existing worlds (mgvalleys is not
stable):

Single lava and water sources not added in tunnels.
Previous caverns are unchanged but an equal number of new ones are
added at a distance from the previous.
From y = -256 to 192 nodes below, where the caverns taper at their
upper limit, they will have a slightly different shape as the taper
is now linear.
2018-04-21 22:50:36 +01:00
Paramat
5abd0efb90
Cave liquids: Use a more precise point for calculating biome
Use the centre point of the route being carved for a more precise match
between cave liquids and biome.
2018-04-21 20:35:29 +01:00
mazocomp
cb92cdf3a4 Fix i386 bit build at OpenBSD (#7259) 2018-04-21 21:33:38 +02:00
Paramat
0e554706ac
Node resolver: Make error on fallback optional, disable for mapgen aliases 2018-04-20 20:26:30 +01:00
rubenwardy
87ad4d8e7f
Add online content repository
Replaces mods and texture pack tabs with a single content tab
2018-04-19 20:14:53 +01:00
SmallJoker
9877a1a207 Fix wrong channel number representation in logs (#7205) 2018-04-18 21:26:28 +02:00
Ben Deutsch
3eac249464 PlayerSettings struct for player movement code (#7243)
Instead of calling g_settings->getBool("flag") multiple times
during each movement step, the current settings are cached
in a new player object member. Updated via registered callbacks.
2018-04-18 20:56:01 +02:00
Muhammad Rifqi Priyo Susanto
b1e58c9c35 Android: Modify touch screen GUI's buttons (#7240)
* Android: Add zoom, minimap, and toggle chat button
Zoom button is put above jump button.
Minimap and toggle chat button are put in settings bar.
* Jump button is rotated down button
* Move three buttons on the right screen higher
2018-04-18 20:55:42 +02:00
Paramat
cca925377b
Cavegen: Fix variable typo that broke mgvalleys large cave distribution (#7249)
Fix elusive 5 year old bug that caused mgvalleys large caves to be flat and
limited to mapchunk borders.
Error was fixed 2 years ago in 'CavesV6' but not in 'CavesRandomWalk'.
2018-04-17 22:25:59 +01:00
Paramat
28813702d6
FOV: Raise lower limit to avoid zoom-loading of distant world (#7234)
In the client, raise lower limit from 30 to 45 degrees, to avoid server
seeing this as a zoom and loading world beyond the server-set limit.
Add minimum in settingtypes.txt and enforce lower limit when set using
minetest.conf.

In the server, distrust the client-sent FOV if below the heuristic zoom
threshold and use the player object property 'zoom_fov' to check it, to
protect against hacked clients.
2018-04-15 21:56:05 +01:00
Muhammad Rifqi Priyo Susanto
326eeca306 Android: Replace movement buttons with joystick (#7126)
* Android: Replace movement buttons with joystick

Replace movement control buttons (arrows at bottom left screen) with virtual joystick.
Joystick has 8 directions (same as keyboard). Basically, just map it to keyboard input.
Joystick applies only on left 1/3 of screen.
Joystick's position can be fixed by enabling fixed_virtual_joystick setting.
Three new images:
(1) placeholder joystick,
(2) joystick container (background), and
(3) joystick cursor.
Remove unused images: movement control buttons (*_arrow.png).
New data type: touch_gui_joystick_move_id

Joystick's fixed position is spaced one button size from bottom and from left of screen.
Remove unused variable: m_joystick_downlocation
2018-04-10 22:55:17 +02:00
sfan5
22ebbe136a
Fix segfault caused by wrong wgettext() 2018-04-09 16:25:57 +02:00
minduser00
9a06d6aa9f Fix for translating empty strings
Fix for incorrect translation of empty strings

In the key change menu, when a button key not have name an empty string is passed to gettext.
The empty string is reserved for gettext to return de header of the .po file an this is shoved in the button
2018-04-09 15:13:53 +02:00
SmallJoker
d58801ab32 upright_sprite: Fix texture position for players
Fixes #6471
2018-04-09 15:06:40 +02:00
Paramat
af868421da
Sun colour: Undo colour change. Remove double assignment (#7227)
Commit 5070ca2111dd5b3f333a942059ef2c592de8dc24 changed sun colour by
fixing what seemed to be a code mistake.
Return to the standard colour but comment-out the first assignment of the
double-assignment for performance.
Add a comment to explain.
2018-04-09 02:23:47 +01:00
Paramat
746ca41f58
Biome API / dungeons: Add biome-defined dungeon nodes
Add new biome fields 'node_dungeon', 'node_dungeon_alt', 'node_dungeon_stair'.
If 'node_dungeon' is not defined dungeons fall back to classic behaviour.

Remove messy and imprecise dungeon material code from 'generateBiomes()'.
Code deciding dungeon materials is now in 'generateDungeons()' and uses the
biome at mapchunk centre for more precision.

Remove hardcoded 'MG_STONE' types as long intended.
2018-04-07 22:09:54 +01:00
Vitaliy
460b375cad Fix SAOM (#7200)
* Bugfix
2018-04-06 16:33:43 +02:00
rubenwardy
91615f9588 Add player:get_meta(), deprecate player attributes (#7202)
* Add player:get_meta(), deprecate player attributes
2018-04-06 10:52:29 +02:00
Paramat
7e3f88f539
Mgcarpathian: Fix spawn level calculation (#7212) 2018-04-06 00:10:16 +01:00
Paramat
5701f9e389
Mgcarpathian: Remove insignificant 'base' noise variation (#7209)
Was only +-1 node over a scale of thousands of nodes.
Replace with 'base_level' parameter value.
2018-04-05 21:52:10 +01:00
Paramat
c6975febba
Zoom adjustDist(): Improve variable name (#7208) 2018-04-05 20:15:38 +01:00
Paramat
32d456bd2d
Biome API / cavegen: Add definable cave liquid for a biome (#7192)
Add 'node_cave_liquid' as a new field in biome registration.
If field is absent cave liquids fall back to classic behaviour.
2018-04-05 17:21:41 +01:00
Loïc Blot
077f231111
[clang-tidy] Promote some performance-* as a coding error (#7194)
* Promote performance-type-promotion-in-math-fn as a coding error
* Promote performance-faster-string-find too (which is not problematic currently)
* Same for performance-implicit-cast-in-loop
* Fix remaining tidy points
2018-04-04 20:49:42 +02:00
Loïc Blot
392e80e3f1
Huge LBM lookup performance improvement on mapblock loading (#7195)
* Huge LBM lookup performance improvement on mapblock loading
2018-04-04 10:56:46 +02:00
Loic Blot
5070ca2111
Fix 5 issues reported by PVS studio
* src/sky.cpp  146     warn    V519 The 'suncolor_f.r' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 142, 146.
* src/sky.cpp  147     warn    V519 The 'suncolor_f.g' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 143, 147.
* src/sky.cpp  148     warn    V519 The 'suncolor_f.b' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 144, 148.
* src/threading/thread.cpp     63      err     V730 Not all members of a class are initialized inside the constructor. Consider inspecting: m_thread_obj.
* src/server.cpp       3243    err     V595 The 'log' pointer was utilized before it was verified against nullptr. Check lines: 3243, 3258.
2018-04-04 08:40:31 +02:00
Loic Blot
8e0b80aa36
Fix last performance-type-promotion-in-math-fn problems 2018-04-04 07:42:40 +02:00
Loïc Blot
a90d27e1e2
Optimize a little bit isBlockInSight, adjustDist & collisions (#7193)
* Use constexpr + unroll some calculations to cache definitively some calculations
* Unroll some calls in collision code & use a constref instead of a copy in one occurence
2018-04-04 00:43:08 +02:00
Loic Blot
05fe3b06c8
Fix last clang-tidy reported problems for performance-type-promotion-in-math-fn
Based on https://travis-ci.org/minetest/minetest/jobs/361810382 output

Also fix 2 missing copyright notices
2018-04-03 23:05:22 +02:00
Loic Blot
4827f754ec
Fix more clang-tidy reported problems for performance-type-promotion-in-math-fn
Based on https://travis-ci.org/minetest/minetest/jobs/361714253 output
2018-04-03 21:58:29 +02:00
Loïc Blot
67a4cb7d8a Fix various clang-tidy reported performance-type-promotion-in-math-fn 2018-04-03 18:16:17 +02:00
SmallJoker
baca933b6b
Selected ItemStack: Reduce black magic (#6520)
* Selected ItemStack: Reduce black magic
Better button variable value naming
2018-04-03 11:15:58 +02:00
Vitaliy
528908a4c3 Optimize entity-entity collision (#6587)
* Add IrrLicht type aliases
* Add hash for IrrLicht vector
* Add object map
2018-04-03 08:23:46 +02:00
Loïc Blot
2481ea27ce
Fix many issues reported by clang-tidy (#7189)
* Fix many issues reported by clang-tidy

We have many issues in code related to some performance to float <-> double.
Clang-tidy reported it in performance-type-promotion-in-math-fn

I fixed many of them. It's not ready for a promote to blocking

Also fix some value which should be const-ref
2018-04-02 23:51:08 +02:00
SmallJoker
e98fd934ce 'fix' LINT, use InventoryLocation== 2018-04-02 17:18:48 +02:00
SmallJoker
9fa547bb80 Run callback in IDropAction, refactor function arguments 2018-04-02 17:18:48 +02:00
SmallJoker
f6eff57f7c Add player inventory callbacks 2018-04-02 17:18:48 +02:00
you
12edb200eb Formspecs: Use mouse wheel to pick up and deposit single items 2018-04-02 15:52:07 +01:00
Loïc Blot
d88c4e1822
LINT: add clang-tidy step (#6295)
* Implement new travis clang-tidy build step

* This step enable some rules and enforce one rule as error
* This permits to have some C++ quality rules based on clang & clang contributor guidelines

* Fix clang-tidy reported problems on push_back -> emplace_back
2018-04-01 23:57:55 +02:00
you
93eb0794d6 ObjectRef: Add add_velocity() (#3208)
Allow changing the velocity of objects relatively to their current velocity
2018-03-31 14:50:17 +02:00
SmallJoker
0a8ca59891 event.h: Fix import GCC warning caused by ce87310 2018-03-31 14:33:54 +02:00
Loïc Blot
ce873108aa
Client eventmanager refactor (#7179)
* Drop EventManager from GameDef & do some client cleanups

* EventManager is only used by Client. Don't expose it on Server & GameDef for nothing
* Drop Client::event() in favor of direct calls to getEventManager
* Cleanup some event put from new + put to put(new)
* MtEvent: add Type(u8) enum
* This will enhance event performance & ensure stricter type
* Drop MtEvent::checkIs (unused)

* clang-tidy reported fixes

* Code style

* Move event_manager.h to the client directory as it's only used by client

Add EventManager unittests + switch to unordered_map as order is not important here

Drop a unused function
2018-03-30 18:32:52 +02:00
Paramat
2c490dddc0
Mgcarpathian: Mapgen loop optimisations. fabs() -> std::fabs()
* Mgcarpathian: ZYX -> ZXY mapgen loop optimisation.

* 'pow(n, 3)' to 'n * n * n' type optimisations.

* fabs() -> std::fabs().
2018-03-29 21:08:42 +01:00
nOOb3167
376ed5cd3c Sound: fix static initialization order dependency by not having one (#7168)
Ensure singleton is reset
2018-03-29 21:43:57 +02:00
stujones11
821e3f7072 Optional alpha channel support for entities 2018-03-29 14:53:12 +01:00
Loic Blot
0396717256
Fix a warning introduced by c5b4e541749c50805519ce040d98a0a8e5e0ec03 2018-03-29 13:54:44 +02:00
Loic Blot
ef979ee2e9
Fix a warning reported by clang
minetest/src/script/cpp_api/s_player.h:27:1: warning: struct 'PlayerHPChangeReason' was previously declared as a class [-Wmismatched-tags]
struct PlayerHPChangeReason;
2018-03-29 13:37:24 +02:00
Loic Blot
83fc0fd2f1
Fix various Client class functions not marked as override (virtual)
Also switch some of them which are reported by clang-tidy
2018-03-29 13:33:32 +02:00
Andrew Ward
71b2570f09
Load dependencies and description from mod.conf 2018-03-28 22:14:16 +01:00
Andrew Ward
dfc8198349
Add reasons to on_dieplayer and on_hpchange 2018-03-28 16:05:18 +01:00
Andrew Ward
2323842dd3
Add formspec theming using prepended strings 2018-03-28 16:04:41 +01:00
nOOb3167
b0fef16a27 Guard sound manager initialization with "enable_sound" (#7167) 2018-03-26 17:44:40 +02:00
D Tim Cummings
9802e59724 macOS: don't require X11 libraries during compilation (#7149)
The xxf86vm needs to be removed from Apple builds to avoid CMake Error XXF86VM_LIBRARY is NOTFOUND
2018-03-26 17:43:59 +02:00
Paramat
2f280cc672
Mapgen: Remove unused mgv7 code and some unused biometypes 2018-03-26 04:59:49 +01:00
nOOb3167
43f98eb47c Make sounds stop playing when entering game or mainmenu 2018-03-24 16:05:26 +01:00
Loïc Blot
4fd9715876
Cleanup sound manager class (#7158)
* Cleanup sound manager client

* Use some const refs
* Use auto on iterators
* Drop unused parameters
* Move sound_openal.* to client folder
* Move sound.cpp + OnDemandSoundFetcher to client/ folder + reorganize includes properly
2018-03-24 15:45:25 +01:00
you
bcd22fc34c Print the mod loading time (#7137)
* Print the mod loading time
2018-03-24 00:31:33 +01:00
Loic Blot
eab652fd52
Fix some gcc 7.3 reported warnings
```
src/client/joystick_controller.h:85:2: warning: duplicate 'virtual' declaration specifier [-Wduplicate-decl-specifier]
        virtual bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const;
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/ext/new_allocator.h:140:22: warning: destructor called on non-final 'JoystickAxisCmb' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
                destroy(_Up* __p) { __p->~_Up(); }
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/ext/new_allocator.h:140:22: warning: destructor called on non-final 'JoystickButtonCmb' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
        destroy(_Up* __p) { __p->~_Up(); }
```
2018-03-23 22:12:48 +01:00
nOOb3167
9293d8e271 Global initialization of sound using SoundManagerGlobal (#7063)
* Global initialization of sound using SoundManagerGlobal
2018-03-23 15:31:43 +01:00
Vitaliy
9fcc0c1217 Update mesh collector and move it to a separate file (#6904)
* Update MeshCollector

* Simplify MeshCollector
2018-03-22 20:59:49 +01:00
paramat
cd6bcef6d9 Minetest ASCII art: Move from actionstream to rawstream 2018-03-21 04:31:46 +00:00
Vitaliy
0358ae789a Fix node-nodebox lighting difference in direct sunlight (#7061) 2018-03-17 10:10:16 +01:00
Loic Blot
e800684ead
Fix a crash or random memory leak when reseting saved environment variable in test_servermodmanager.cpp 2018-03-16 19:34:41 +01:00
Loic Blot
478b785bc8
Drop Server::m_enable_rollback_recording it's only used in server constructor 2018-03-16 09:12:39 +01:00
Loic Blot
95ce5583a9
ServerEnvironment::loadDefaultMeta: Loading default meta is only possible for ServerEnv itself 2018-03-16 08:52:42 +01:00
Loic Blot
858c95630f
Forgot to remove obsolete Server::m_mods 2018-03-16 08:44:57 +01:00
Loïc Blot
6c184947c3
Server: delegate mod management & config to ServerModConfiguration (#7131)
* Server: delegate mod management & config to ServerModConfiguration (rename it to ServerModManager)

* Use c++11 range based loops
* Add unittests + experimental/default mod as a test case to permit testing mod loading in future tests
2018-03-16 08:41:33 +01:00
Loic Blot
5e61f64ce2
Fix an alone if to be with a missing else 2018-03-16 08:40:21 +01:00
paramat
19c993bc39 Biomes: Fix vertical biome blend 2018-03-16 02:59:38 +00:00
paramat
7ad6cdd09b Biome API: Add 'get_biome_name(biome_id)' API
Change name of default biome to a more suitable lowercase 'default'.
2018-03-11 23:06:17 +00:00
Loïc Blot
a09a994417
Add Voxelarea unittests (#7121)
* Add voxelarea unittests
2018-03-11 21:16:19 +01:00
Loic Blot
f7938fab9f
Finally fix android build 2018-03-11 17:52:46 +01:00
Loic Blot
a1c5a01142
Fix Android build, but there is a remaining linking issue in guiConfirmRegistration
* Also fix variable name overloading in guiConfirmRegistration
2018-03-11 17:45:58 +01:00
stujones11
22a891a925
Android build fixes for c++11 2018-03-11 16:56:27 +01:00
Vitaliy
cf8d579abc Drop texture file list cache (#6660) 2018-03-10 19:33:37 +01:00
SmallJoker
ee20433425 Fix typo in lighting code since bcdb3d5 2018-03-10 09:37:43 +01:00
paramat
644d0ab2bb Spawn level: Add 'get_spawn_level(x, z)' API
Returns a suitable player spawn y co-ordinate for unmodified terrain.
2018-03-10 03:38:27 +00:00
SmallJoker
473d81f2e2 Formspecs: Unify textarea and field parsing functions, fix wrong fallback text
* textarea[], field[]: Unify function, fix wrong fallback text
* Remove apparently superflous mainmenumanager.h incldue
* intlGUIEditBox.cpp: make read-only boxes really read-only
* Use elseif (trivial)
2018-03-09 23:24:57 +00:00
Loic Blot
12d1e4ff04 VoxelArea: add_{x,y,z,p} must be static
Fix some documentations issues
Use getNodeNoCheck(v3s16, ...) in some cases instead of getNodeNoCheck(x, y, z, ...)
2018-03-09 23:27:26 +01:00
Loic Blot
3b27cf30d9 Drop unused struct ModLicenseInfo & ModAuthorInfo + default constructor in ModMetadata 2018-03-09 23:27:26 +01:00
Loic Blot
2c860a6a42 ServerEnvironment & StaticObject cleanups
* isFreeServerActiveObjectId is now part of ServerEnvironment
* getFreeServerActiveObjectId is now part of ServerEnvironment
* StaticObject constructor now take ServerActiveObject instead of type + string. This permits to remove a big string copy in some code parts
2018-03-09 23:27:26 +01:00
Loic Blot
def46c6cdb Drop unused Server::m_ignore_map_edit_events_peer_id 2018-03-09 23:27:26 +01:00
Loic Blot
bcdb3d56c0 Variable name fix + structure creation unrolling in lighting code 2018-03-09 23:27:26 +01:00
Loic Blot
6036f865cb Drop less performant Server::setBlockNotSent for ClientInterface::markBlockposAsNotSent 2018-03-09 23:27:26 +01:00
paramat
1a88c4b7a5 Getv3intfield: Fix logic of return bool 2018-03-09 03:16:25 +00:00
paramat
cbb9301bea Biomes: Add 'min_pos'/'max_pos' xyz biome limits
'y_min' and 'y_max' are still accepted for compatibility.
2018-03-09 03:16:25 +00:00
Loic Blot
c7c03ad7a6 Cleanup & bugfix
* ObjectRef::set_local_animation: fix wrong lua return (should push a boolean, currently returns nil)
* ObjectRef::set_eye_offset: fix wrong lua return (should push a boolean, currently returns nil)
* Fix various Server functions which depends on RemotePlayer objet and return true/false when player object is nil whereas it's a caller implementation error. Change those bool functions to void and add sanitize_check call instead. Current callers are always checking player object validity
* Optimize Server::setClouds : use CloudParams object ref instead of attribute deserialization from structure & perform RemotePlayer::setCloudParams directly in server class like many other calls
* Optimize Server::SendCloudParams: use CloudParams object ref instead of deserialized attributes
2018-03-08 23:00:17 +01:00
Loic Blot
c7656edaa5 Cleanup: drop Server::hudGetHotbarSelectedImage()
Call directly accessible RemotePlayer::getHotbarSelectedImage() from server api
2018-03-08 23:00:17 +01:00
Loic Blot
4be46aeeb1 Cleanup: drop Server::hudGetHotbarImage()
Call directly accessible RemotePlayer::getHotbarImage() from server api & make it const ref
2018-03-08 23:00:17 +01:00
Loic Blot
373f1bfb4a Cleanup: drop Server::hudGetHotbarItemcount()
Call directly accessible RemotePlayer::getHotbarItemcount() from server api
2018-03-08 23:00:17 +01:00
Loïc Blot
f35236afea
mods.cpp/h: little performance improvement in getModsInPath (+ codestyle) (#7108)
* mods.cpp/h: little performance improvement in getModsInPath
2018-03-08 20:03:43 +01:00
you
540e07e3ef Fix missing warningstream (or similar problem) (#7034)
Use the --color command line parameter instead of a setting for coloured logs

This fixes the missing warningstream bug, g_settings->get mustn't be used there.
Also, the decision about en- or disabling log colours fits better to the command line parameters than minetest settings.
2018-03-04 17:34:36 +01:00
Brian
929792e15e Allow for getting world name and path separately on the command line (#6555)
Change to --worldlist instead of --world list.

Gets rid of --worldpath parameter added as part of this pull request,
instead moving the listing function to a command --worldlist that
accepts either name, path, or both and prints out the corresponding
information.
2018-03-04 17:34:09 +01:00
paramat
48493a979b Gennotify: Add 'minetest.get_decoration_id' API
Returns the decoration ID for the provided decoration name string.
For use with gennotify, to know the decoration IDs for use in
'minetest.set_gen_notify'.
2018-03-03 23:00:08 +00:00
paramat
07622bf9b4 Generate Notifier: Clear events once after all 'on generated' functions 2018-03-03 22:59:49 +00:00
Gael-de-Sailly
b952d42000 MapgenValleys: Fixed submarine valleys shape 2018-03-03 22:59:26 +00:00
SmallJoker
ebbd158774
c_converter: Function template for numeric fields, add v3s16 default (#7090) 2018-03-03 10:59:43 +01:00
SmallJoker
a1cf8a127c
Slippery: Simplify, make more efficient (#7086)
Use already existing collision results for the nearest colliding node
Fix slippery effect in free_move mode
2018-03-03 10:59:14 +01:00
Vitaliy
f5fd4a0af1 Cleanup in flat lighting (#7051) 2018-03-03 10:58:45 +01:00
red-001
e7f1611991 Fix liquid post effect colour behaviour in third person view 2018-02-27 19:40:10 +00:00
paramat
c610643c4c Place schematic (on vmanip): Enable use of 'place center' flags
For 'place schematic' and 'place schematic on vmanip' APIs.
Fix 'place center' code to properly centre schematics.
Fix some comments.
2018-02-27 19:39:05 +00:00
paramat
6c9df2ffa7 CollisionMoveSimple: Collide with 'ignore' nodes 2018-02-26 17:21:45 +00:00
paramat
359a940dde SAO limits: Allow SAOs to exist outside the set 'mapgen limit' 2018-02-26 17:21:45 +00:00
nOOb3167
88a7160ad8 Fix CMake error (#7074) by bumping the required CMake version past 3.8.1 (#7075) 2018-02-25 12:26:41 +01:00
nOOb3167
4118e150f8 CMakeLists use the source_group command to improve look and feel when generating Visual Studio projects.
The TREE argument of source_group appears in CMake 3.8 therefore check for version.
2018-02-23 17:02:02 +01:00
nOOb3167
cbf891ef1d CMakeLists pass windows sources (manifest and resource file) to executable targets separately from common_SRCS 2018-02-23 17:02:02 +01:00
SmallJoker
57418111a8
Registration dialog: Larger text field with scrollbars (#7047)
Center text, text area doubled now
2018-02-23 17:01:05 +01:00
paramat
673f7196a2 Find nodes in area (under air): Raise volume limit and document it 2018-02-21 15:54:06 +00:00
paramat
f9ad061910 Vertical biome blend: Tune blend patterns 2018-02-20 15:28:52 +00:00
paramat
2bc7c5ff93 Dungeons: Add Y limits in all mapgens
Preserve the upper limit used in mgvalleys.
2018-02-20 15:25:37 +00:00
red-001
4bb41a19dc Mitigate formspec exploits by verifying that the formspec was shown to the user by the server. (#6878)
This doesn't check the fields in anyway whatsoever so it should only be seen as a way to mitigate exploits, a last line of defense to make it harder to exploit bugs in mods, not as a reason to not do all the usually checks.
2018-02-18 22:33:42 +01:00
sfan5
3f2e0c1206 Check argument types inside MetaDataRef Lua API (#7045) 2018-02-18 10:40:45 +01:00
red-001
ae6aed15cf Remove legacy chat network code. (#6954) 2018-02-17 19:23:21 +01:00
Vitaliy
11928b7af1 Render copyright notice: Fix name spelling (#7042) 2018-02-15 21:19:34 +01:00
red-001
338d645fcf Add on_auth_fail callback (#7039)
Called when a client fails to supply the correct password for the account it's attempting to login as.
2018-02-15 21:18:54 +01:00
paramat
861cfd8484 Dungeons: Avoid generation in multiple liquid nodes and 'airlike'
Previously only 'mapgen water source' and 'mapgen river water source'
were checked for. Games can use multiple liquid nodes defined for biomes,
many of which will not be aliased to those 2 mapgen aliases, causing
floating dungeons to generate in some liquids.

Now we check for liquid drawtype instead, so can remove liquid nodes
from dungeonparams.

Also check for 'airlike' drawtype instead of 'CONTENT_AIR' to avoid
generation in 'airlike' nodes in some rare situations. This will also be
needed for when we add definable biome air nodes.
2018-02-13 03:48:39 +00:00
Loic Blot
359c8f82ce
map.cpp: Initialize NodeNeighbor, set NeighborType to u8 & cleanup
Cleanup:
* Drop unused Map::transforming_liquid_size()
* NodeNeighbor must use const ref for v3s16
* Add a missing default in a switch case
2018-02-11 09:23:25 +01:00
Dániel Juhász
3face01a20 Node definition manager refactor (#7016)
* Rename IWritableNodeDefManager to NodeDefManager
* Make INodeDefManager functions const
* Use "const *NodeDefManager" instead of "*INodeDefManager"
* Remove unused INodeDefManager class
* Merge NodeDefManager and CNodeDefManager
* Document NodeDefManager
2018-02-10 21:04:16 +01:00
stujones11
617d94c803 Position entity nametags relative to selection-box (#7031) 2018-02-10 10:42:33 +01:00
SmallJoker
af89a25ff3 Fix 'Change Keys' menu crash caused by 501f936 2018-02-09 09:39:34 +01:00
ThomasMonroe314
501f936b37 Switch F3 to use 'enable_fog' setting 2018-02-08 15:40:16 +01:00
stujones11
e87b410a33 Include alpha channel reference in MaterialTypeParam 2018-02-08 15:38:49 +01:00
red-001
1e94a7feaf Move setlocale from Lua to C++. 2018-02-08 15:38:34 +01:00
PorygonZRocks
0e4c467a82 Add main_menu_style setting 2018-02-08 15:38:24 +01:00
lisacvuk
4f5090ff68 Make hud_get return aligment, offset and size. (#7006)
* Make hud_get return aligment and offset.

* Return size aswell.
2018-02-04 10:17:46 +01:00
Dániel Juhász
735fc2a1f2 Remove unused light updating code
Also remove the unit test that tests the removed algorithms.
2018-02-04 03:16:45 +00:00
sfan5
cf0bcebc76 Refine movement anticheat again (#7004)
* Account for walking speed in vertical dir
* Avoid undefined behaviour due to division-by-zero
2018-02-02 23:34:09 +01:00
number Zero
49b65a5593 Fix liquid bottoms not being rendered 2018-01-30 21:13:24 +01:00
Loïc Blot
584d00a01c
Add minetest.bulk_set_node call + optimize Environment::set_node call (#6958)
* Add minetest.bulk_set_node call + experimental mod unittest

* Optimize set_node function to prevent triple lookup on contentfeatures

Do only one lookup for old, and try to merge old and new lookup if node is same than previous node

* Add benchmark function + optimize vector population to have real results
2018-01-30 00:30:02 +01:00
sfan5
de2c40c8fc Apply physics overrides correctly during anticheat calculations (#6970) 2018-01-28 10:21:21 +01:00
SmallJoker
7d3295e21f [CSM] HUD Fix not updating server HUDs caused by 4f688d5 2018-01-26 21:27:30 +01:00
red-001
4f688d5616 Fix issues with earlier CSM HUD commit (#6940)
The CSM HUD PR caused some strange behavior including aborts due to parts of it using some slightly hacky code, the event refactor changing how events are processed and a minor oversight.
2018-01-26 16:05:47 +01:00
lisacvuk
62c10e3d08 Disable fall damage when "immortal" group set (#6946) 2018-01-23 19:28:21 +01:00
red-001
0425c6b8c8 CSM: Remove screenshot API
Reverted from commit 19960e26c672c6337f8c6ffbe27f2c6bca49750c
(* [CSM] add screenshot api lua)
2018-01-23 05:27:38 +00:00
red-001
d6050bee51 [CSM] Don't Load the package library (#6944)
Already removed by a latter step in CSM init so this just saves on pointless work.
2018-01-22 08:34:49 +01:00
Wayward One
684e70477d Change include from "cmake_config.h" to "config.h"
Fixes #6894
2018-01-21 23:25:04 +01:00
red-001
49ff1d2ea8 [CSM] Remove on_connect callback (#6941)
Fixes #6939
2018-01-21 18:27:27 +01:00
red-001
5dab742645 [CSM] Add functions to create particles and particlespawners. (#6072) 2018-01-20 23:31:53 +01:00
Loic Blot
99c9e7a986 Game refactor [4/X]: keycache is now owned by InputHandler
* Make InputHandler own the key cache
* Add a helper function InputHandler::cancelPressed to avoid multiple similar calls in game.cpp
* Move RandomInputHandler::step definition into cpp file
2018-01-20 16:38:38 +01:00
Loic Blot
f5a006dce7 Game refactor [3/X]: Move keycache to inputhandler 2018-01-20 16:38:38 +01:00
Loic Blot
64fe79b53b Game refactor [2/X]: Various moves (profilergraph, nodePlacementPrediction, create_formspec_menu)
* Move profilergraph to dedicated files
* Move nodePlacementPrediction to Game class
* Rename create_formspec_menu to GUIFormSpecMenu::create
2018-01-20 16:38:38 +01:00
Loic Blot
362323cdc2 Game/Input refactor [1/X]: make RealInputHandler handle joystick inputs with standard input
Joystick input is a RealInputHandler only usage, make it intelligent and handle the joystick with keyboard direct.
This permits to remove many getters in game which should be owned by RealInputHandler
2018-01-20 16:38:38 +01:00
red-001
9649e47214 [CSM] Add basic HUD manipulation. (#6067)
* [CSM] Add basic HUD manipulation.

Workaround for on_connect not working right now.
2018-01-20 14:09:58 +01:00
paramat
d45e5da8ca Biomes: Add 'get heat', 'get humidity', 'get biome data' APIs
'get biome data' returns biome id, heat and humidity.
Clean up nearby lines in lua_api.txt.
2018-01-16 08:47:07 +00:00
red-001
4c0d4e4105 Load a texturepack from the 'textures' subfolder of a game 2018-01-16 08:45:17 +00:00
paramat
142474196a Mapgen folder: Update and improve copyright information of files 2018-01-15 04:42:08 +00:00
Muhammad Rifqi Priyo Susanto
670f8afd18 Registration confirmation dialog: Fix grammar
Fixes commit 792752997c5ae2aaa4f54d0a2e2af2a96d7d1e9f.
2018-01-13 19:30:34 +00:00
Muhammad Rifqi Priyo Susanto
792752997c Add confirmation on new player registration (#6849)
* Attempt to add registration confirmation

Using SRP auth mechanism, if server sent AUTH_MECHANISM_FIRST_SRP that means the player isn't exist.
Also tell player about the server and chosen username.
Local game has localhost as IP address of the server.
Add RenderingEngine::draw_menu_scene() to draw GUI and clouds background.
aborted -> connection_aborted

* Rewrite information message text

Client::promptConfirmRegister() -> Client::promptConfirmRegistration()
2018-01-13 12:07:16 +01:00
Lars Hofhansl
fad263dec9 Revert "Add an active object step time budget #6721"
This reverts commit 9c669016d1578a5c62f932c6ccb7a2b4b1e21f0a.
See #6907
2018-01-12 23:47:39 -08:00
Loic Blot
6f2fe8a554
Forget to fix non freetype build in StaticText 2018-01-12 08:36:38 +01:00
number Zero
b4df0d67dd Fix ambient occlusion and dark lines at mapblock borders 2018-01-12 05:44:11 +00:00
Pedro Gimeno
f77f19a941 Fix off-by-one in log output line length (#6896) 2018-01-09 19:07:14 +01:00
Pedro Gimeno
63f4ee21b0 Fix buffer parameter not working in LuaPerlinNoiseMap::l_getMapSlice() 2018-01-08 20:32:15 +00:00
rubenwardy
0a83c42dfd
Fix naming conventions of noise userdata 2018-01-07 01:06:18 +00:00
Loic Blot
9146c6a50f Don't recalculate statustext initial color everytime & review fixes 2018-01-05 20:59:30 +01:00
Loic Blot
f40f4143df GameUI refactor (part 7/7): Finish to include profiler things to GameUI
Other changes:
* Add GameUI clarification comment
* Move force_fog_off & disable_camera_update flags from GameUI to Game, it's not UI related
* Properly init GameUI::Flags
* Move toggleChat toggleHud & toggleProfiler to GameUI
* Add gameui.cpp to LINT whitelist
2018-01-05 20:59:30 +01:00
Loic Blot
02f82eca0b GameUI refactor (part 6/X): Move Game::guitext_profiler & showStatusTextSimple to GameUI class
Other enhancements:
* Move showStatusTextSimple to GameUI class & rename to showTranslatedStatusText
2018-01-05 20:59:30 +01:00
Loic Blot
326b0faa5e GameUI refactor (part 5/X): Move Game::guitext_chat to GameUI class
Other enhancements:
* Move update_profiler_gui to Game class
* Move updateChat to Game class
2018-01-05 20:59:30 +01:00
Loic Blot
fe510d90c1 GameUI refactor (part 4/X): Move Game::guitext_status, Game::m_statustext, GameRunData::statustext_time to GameUI class
Other enhancements:
* Simplify setStatusText to showStatusText, as it shows the label too (preventing almost every setStatusText to call setStatusTextTime(0)
* Add unittests
2018-01-05 20:59:30 +01:00
Loic Blot
aab3b18e4b GameUI refactor (part 3/X): Move Game::guitext2, Game::guitext_info, Game::infotext to GameUI class
Other enhancements:
* Drop unused GameRunData::time_of_day
* Little GameUI::update code path optimizations
2018-01-05 20:59:30 +01:00
Loic Blot
3a772e7ed6 GameUI refactor (part 2/X): Move Game::guitext to GameUI + enhancements on StaticText
Other enhancements:
* C++ friendlyness for addStaticText() -> move to static StaticText::add()
2018-01-05 20:59:30 +01:00
Loic Blot
0ebaed430a GameUI refactor (part 1/X): GameUI object creation + GameUIFlags move to GameUI
Game class is too huge and has too specialization on various subjects, like UI, formspecs, client, renderer. Start to move UI related things to GameUI object and cleanup them

Other improvements:
* updateChat: more performance on error messages by remove string copies
* Initialize all game class members in definition instead of constructor (with nullptr instead of NULL)
* Drop unused Client::show{GameChat,GameHud,Profiler,GameFog}
* Add GameUI unittests
2018-01-05 20:59:30 +01:00
Paramat
549cfd9db8 Biomes: Add vertical biome blend (#6853)
Add 'vertical blend' parameter to biome registration that defines how
many nodes above the biome's 'y max' limit the blend will extend.
2018-01-05 00:10:55 +01:00
you
e7b44c3295 Fix Wstringop-overflow warning from util/srp.cpp (#6855)
* Fix Wstringop-overflow warning from util/srp.cpp
2018-01-04 14:25:20 +01:00
red-001
30821ad8de [CSM] Don't load the IO library. (#6087)
* [CSM] Don't load the IO library.

* Rename the function to match the Lua API function name and add a missing `const`

* Add a comment to explain some strange code and fix the other issues pointed out by shadowninja.
2018-01-04 08:21:12 +01:00
rubenwardy
2af47e6f5f Fix crash on can_bypass_userlimit returning non-boolean 2018-01-03 14:18:13 +00:00
paramat
2aad3be2cb Mgv7 floatlands: Add exponent parameter
Allows more control over shape of floatland mountain terrain.
Terrain shape is unchanged.
2018-01-03 04:05:55 +00:00
Thomas--S
f3b9d87076 Connected Nodeboxes: Add disconnected boxes
The `disconnected_*` boxes are the opposites of the `connect_*` ones,
i.e. when a node has no suitable neighbours on the respective side, the
according disconnected box is drawn.

* disconnected_top
* disconnected_bottom
* disconnected_front
* disconnected_left
* disconnected_back
* disconnected_right
* disconnected (when there is *no* neighbour)
* disconnected_sides (when there are *no* neighbours to the sides)
2018-01-03 04:05:21 +00:00
Hybrid Dog
345e1041a2 Tool.cpp/.h, lua_api/l_util.cpp: Tidy up code and remove dead code 2018-01-03 04:01:15 +00:00
Hybrid Dog
d7c1f6c92e Tool getDigParams: Fix selecting the best fitting time
Previously, time was compared with result_time before dividing it by
the level difference.
2018-01-03 03:58:11 +00:00
Loïc Blot
0d6b58a772
Add unittests on ActiveObject and BanManager class (#6866)
* Add unittests on ActiveObject and BanManager class

This also permit to fix a bug in ban manager setting bans modified when no modification occurs
2018-01-01 18:48:52 +01:00
rubenwardy
026ad912af Fix rounding error in g/set_node caused by truncation to float 2017-12-26 21:55:08 +00:00
rubenwardy
0bcc2f33eb Add check to pause game on lost window focus 2017-12-26 21:53:45 +00:00
Dániel Juhász
2153965cf9 Line_of_sight: Improve using VoxelLineIterator
This commit rewrites line_of_sight with VoxelLineIterator.
Stepsize is no longer needed, the results will be always accurate.
2017-12-26 21:51:32 +00:00
number Zero
189daf87a0 Fix dancing text 2017-12-25 15:00:50 +01:00
Rob Blanckaert
787cd15c14 - Clear colors when reading property info.
- Set vertex colors on upright_sprites.
2017-12-25 15:00:25 +01:00
nOOb3167
7354d0f3d8 Fix undefined behaviour on getting pointer to data in empty vector
`&vector[0]` is undefined if vector.empty(), causing build failure on MSVC
2017-12-22 10:39:25 +00:00
Vitaliy
257626ceed Fix wrong scrolling (#6809) 2017-12-21 20:58:06 +01:00
Jordan Irwin
18b921015a Allow 'default' parameter in 'settings:get_bool' function
Default value is used when the setting key is not found in the config
file. If default value is not set, 'nil' is returned.

#6188
2017-12-17 15:27:37 +00:00
Ezhh
26c7e98e3d Adjust default console height
#6797
2017-12-17 04:38:54 +00:00
Vitaliy
770eb09adc Fix items turning black (#6780) 2017-12-16 17:01:37 +01:00
paramat
f1d2bc0965 Zoom: Add 'disabled by game or mod' message 2017-12-14 20:59:54 +00:00
paramat
8a99c8c94a Minimap messages: Improve 'disabled by server' message 2017-12-14 20:59:54 +00:00
SmallJoker
6e5109fd46
Chat: Remove prompt history duplicates (#6762) 2017-12-14 19:47:29 +01:00
adrido
551c12391a directiontables: Fix MSVC compiler error (#6785) 2017-12-14 19:46:42 +01:00
Vitaliy
2d9f0d344e Update light decoding table size (#6696)
Fix old undiminish_light bug
2017-12-12 19:29:55 +01:00
Loïc Blot
308bb69eef
CSM fixes: load mods after flavours & add flavour to block mod loading (#6738)
* CSM fixes: load mods after flavours & add flavour to block mod loading

* Don't permit to load mods twice

* Prepare builtin integrity global algorithm

* Add missing doc & use a nicer byteflag for LOAD_CLIENT_MODS flavour

* flag typo fix

* Invert CSM_FL_LOOKUP_NODES & CSM_FL_LOAD_CLIENT_MODS ids
2017-12-11 17:33:44 +01:00
ThomasMonroe314
419799b831 F5 debug info: Add colons, use lowercase except for FPS and RTT 2017-12-10 14:24:28 +00:00
SmallJoker
03caa1e319 Damage: Remove damage ignore timer 2017-12-10 14:23:45 +00:00
adrido
d677f292cc Use std::vector instead of dynamic C-Array (#6744) 2017-12-10 09:07:24 +01:00
Lars Hofhansl
9c669016d1 Add an active object step time budget #6721
This can be set via the active_object_interval option.
2017-12-06 12:21:54 -08:00
you
e049405fdc Add coloured logs (#4549)
The setting log_colour can be used to en-/disable or autodetect it.
2017-12-06 18:50:39 +01:00
Luis Cáceres
2b5341c518 Ensure no item stack is being held before crafting (#4779) 2017-12-06 17:32:05 +01:00
Lars Hofhansl
fd9f195fcc Use Irrlicht's mesh cache for animated meshes.
Fixes #6676.
Allow animated meshes to be cached in Irrlicht's builtin mesh cache.
Use Material.EmmissiveColor instead of manipulating the mesh' vertex colors.
2017-12-04 22:29:11 -08:00
paramat
f470cb7270 Zoom: Set zoom FOV per-player using a player object property
Remove player object property 'can zoom'.
Add player object property 'zoom fov'.
Remove clientside setting for 'zoom fov'.
Object property default is 15 degrees in creative mode, zoom disabled
in survival mode.

Needed due to zoom now loading and/or generating distant world
according to zoom FOV.

Update object properties serialisation version to 3.
2017-12-04 02:25:10 +00:00
Lars Hofhansl
5a03b1f5f9 Optionally extend the active object in a players camera direction.
See #6667

By setting active_object_send_range_blocks > active_block_range a server admin
can allow clients to retrieve active objects futher out from the player at
relatively low cost to the server
(only objects in the players' view cone are considered).
2017-12-03 17:52:05 -08:00
raymoo
83b12ed481 Shut down mapgen threads before other shutdown tasks (#6689)
Solves some issues with ModStorage functionality in mapgen threads
that occurred when mapgen threads continued to run after the main
server thread had stopped. Also shuts down mapgen threads before
shutdown callbacks are called.
2017-12-03 10:28:35 +01:00
SmallJoker
089f594582 CAO/SAO: Nicer velocity-controlled, interpolated rotation property:
'automatic_face_movement_max_rotation_per_sec'.
Rotate towards the smaller angle.
2017-12-01 05:36:49 +00:00
Lars Hofhansl
f4fedfed07 Turn off verbose info message introduced accidentally with ae9b1aa 2017-11-29 22:55:37 -08:00
paramat
ea1ae07beb F5 Debug info: More compact, return to 2 lines
All data fits on width 960, most useful data still visible on width 800.
2017-11-27 01:28:47 +00:00
sfan5
813d819d15 Hint at problematic code when logging deprecated calls 2017-11-27 01:28:39 +00:00
paramat
03c11a73d8 Light curve: Add and tune mid boost gaussian
Create a closer match to the light curve of 0.4.16 stable.
Results in darker shadows while maintaining the 'brightness' and light
spread.
2017-11-27 01:28:29 +00:00
SmallJoker
990d0b0264 Inventory: Restrict access from too far away 2017-11-24 05:39:47 +00:00
paramat
912ba1e47f Clearobjects: Send progress messages to terminal using actionstream
Change default mode to 'quick' as 'full' can lock up a server for a
long time.
2017-11-24 05:38:53 +00:00
paramat
4b553ece09 Stratum ore: Add option for a constant thickness stratum
Add a 'stratum thickness' integer parameter, as an alternative
to providing a 2nd noise parameter for thickness variation.
2017-11-19 00:25:39 +00:00
shivajiva101
3f8e2e8c38 Fix mousewheel behaviour in textarea (#6641)
Allowing scrolling with the mousewheel when the vertical scrollbar is
hidden, unnecessarily exposes oversized containers and newlines at the
end of the text. For example try scrolling over the textareas in the
pause menu. This PR addresses the issue by requiring the scrollbar to be
visible before allowing the scrolling with the mousewheel.
2017-11-18 14:58:08 +01:00
Vitaliy
0780ee51c5 Fix dark liquids (#6621)
* Update light storage format
2017-11-18 10:57:22 +01:00
paramat
ec93893c7f Biome dust node: Only place on 'walkable' cubic non-liquid drawtypes
No longer decide placement on 'buildable_to' parameter.
Dust nodes only look acceptable placed on cubic nodes.
Modders may not want to make their plantlike decorations 'buildable_to'.
2017-11-17 19:27:06 +00:00
number Zero
05d93c7fa1 Load files from subfolders in texturepacks
Updated and rebased version of a PR by red-001
2017-11-17 19:23:08 +00:00
Lars Hofhansl
ae9b1aa177 Allow zoom to actually show more data.
This allows the client to retrieve blocks at a greater distance
from the server, thus allowing for a real zoom.
2017-11-15 22:03:58 -08:00
Vitaliy
ee6bb5a315 Fix item and wield meshes (#6596) 2017-11-14 19:23:34 +01:00
paramat
a0c8c05242 PlayerSAO damage: Update to cope with variable player heights
Nearby codestyle cleanup.
2017-11-14 00:38:36 +00:00
Vitaliy
20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00
sfan5
b692454f70 Add minetest.safe_write_file() to script API 2017-11-08 16:14:05 +01:00
Muhammad Rifqi Priyo Susanto
9526c68699 Fix issue Minetest crash when custom font path is not exist
We try to use default fallback for both mono and main font when custom font path is not exist. This way, if Minetest is not corrupted, we could avoid crash.
2017-11-08 16:14:00 +01:00
paramat
179476d833 LINT: Add files to whitelist, fix detected indent errors 2017-11-06 12:54:08 +00:00
paramat
4c40e0775c Player eye height: Make this a settable player object property 2017-11-06 12:54:00 +00:00
Lars Hofhansl
6be6fb78a4 Do not scale texture unless necessary.
This avoids scaling textures to 'texture_min_size' unless it is actually
required (because either auto-scaling or bi/trilinear filtering is enabled)
2017-11-04 18:05:55 -07:00
sfan5
21f3237fe9 httpfetch: Enable gzip support 2017-11-04 22:19:27 +01:00
Vitaliy
28841961ba Rewrite rendering engine (#6253)
* Clean draw_*() arguments

* Split rendering core

* Add anaglyph 3D

* Interlaced 3D

* Drop obsolete methods
2017-10-31 19:27:10 +01:00
Rob Blanckaert
65c5539035 Add sha1 to lua utils. (#6563) 2017-10-30 08:18:18 +01:00
miqlas
a95e0d1876 Initial Haiku support (#6568)
* Iitial Haiku support
2017-10-30 08:17:43 +01:00
rubenwardy
cd1140f69c Fix day_night_ratio_do_override not being initialised server-side
Causes get_day_night_ratio() to return unpredictable results.
2017-10-29 18:31:53 +00:00
lisacvuk
c252ed506e CSM: Add a way to get current locale from CSM 2017-10-29 12:05:16 +00:00
paramat
241fe649f7 Biome API: Add decoration flags for underground decorations
Add "all_floors" and "all_ceilings" flags for simple and schematic
decorations. Decorations are placed on all floor and/or ceiling surfaces.
Decorations are placed before dungeon generation so placement in dungeons
is not possible.

Add 'getSurfaces()' function to mapgen.cpp that returns 2 arrays of y
coordinates for all floor and ceiling surfaces in a specified node column.

Move 'getHeight()' checks into DecoSimple and DecoSchematic. Delete
'getHeight()' functions.
2017-10-29 12:02:55 +00:00
raymoo
a637107a4e Allow overriding tool capabilities through itemstack metadata
This makes it possible to modify the tool capabilities of individual
itemstacks by calling a method on itemstack metadata references.
2017-10-29 11:57:38 +00:00
lhofhansl
610ea6f216 Avoid filtering low-res textures for animated meshes (incl. players) (#6562) 2017-10-28 10:33:47 +02:00
Esteban I. Ruiz Moreno
2efccb3536 Add missing? include 2017-10-26 20:35:32 +02:00
Lars Hofhansl
0732bf73a4 Reduce server FOV with forward speed
This causes blocks in front of the player to be rendered sooner and
blocks in the periphal view (that would soon be out of view) a bit later.
Overall this leads to smoother rendering as the player is moving around.
2017-10-25 23:13:06 -07: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
Lars Hofhansl
cdedaac5e2 Set range of blocks to retrieve per roundtrip to 2.
This is a small, partial revert of #6483, which had set this to 1.
2017-10-19 09:47:58 -07:00
Loic Blot
f36e323175
directiontables.cpp: fix a warning reported by VS2017 2017-10-17 22:29:15 +02:00
asl97
38b0e26679 Fix inventory drag drop flag (#6416) 2017-10-17 21:50:58 +02:00
Esteban I. RM
5e24ca05fd
Add updated settings_translation_file 2017-10-17 19:22:10 +02:00
Esteban I. RM
792e013eaf
don't pass g_settings around, and use it directly 2017-10-17 19:22:09 +02:00
Esteban I. RM
93d185ee5d
Regenerate minetest.conf.example and translation file 2017-10-17 19:21:35 +02:00
Esteban I. RM
0e8ee84d74
Implement #6096 2017-10-17 19:21:32 +02:00
SmallJoker
46f7fe91a2 Fix strict_protocol_version_checking functionality after ee9a442 2017-10-16 20:12:48 +02:00
Esteban I. RM
90e7d42375 Don't try to craft a non-existent item 2017-10-16 10:13:45 +02:00
Vitaliy
75320e7e88 Real global textures (#6105)
* Real global textures

* Add world-aligned textures
* Update minimal to support world-aligned tiles
* Update minimal
2017-10-15 09:34:14 +02:00
lhofhansl
6bab695479 Cache server config settings. (#6530)
* Cache server config settings.
2017-10-15 09:32:17 +02:00
Lars Hofhansl
b97b9a550f Retrieve a small cone of blocks in the direction of the players velocity.
This helps retrieving the right set of blocks when the player is falling,
traveling on cart, or in general traveling in a direction different from
the view direction.
2017-10-13 20:43:58 -07:00
SmallJoker
6b23cabe51 Formspec: Fallback to 'label' in readonly textarea[]
Guarantees backwards compatibility for this formspec element change
2017-10-13 23:14:39 +02:00
paramat
9a41a3d0f1 Simple decorations: Make 'place_offset_y' usable with simple decorations
Necessary for placing the base cube of 'plantlike_rooted' drawtype in the
seabed instead of on it.
Useful for placing decorations sunk into, or buried in, the ground.
2017-10-10 19:57:28 +01:00
DTA7
2cf9014160 Smooth lighting: Fix light leaking through edge-connected corners
For solid nodes, the lighting at a corner becomes face-dependent, which
means that only the four nodes in face-direction contribute to the
lighting (getSmoothLightSolid).
For special nodes, which use the lighting values at the eight corners of
a node, the lighting is not face-dependent, but certain nodes of the
eight surrounding nodes of a corner (here indices 4, 5, 6 and 7) can be
obstructed.

Ambient occlusion now also occurs for solid nodes, if two, three or four
of the four nodes in face-direction are solid.
2017-10-10 19:53:13 +01:00
Loic Blot
1ff5c20442
Fix warnings introduced by 9b8fa99fe30728c1fcfa73cdf74211841bdae9fb 2017-10-10 19:30:18 +02:00
Loïc Blot
32ae492657 Thread: fix a crash on Windows due to data race condition on Thread::m_start_finished_mutex (#6515) 2017-10-10 12:27:08 +02:00
Loic Blot
9d295906ef
NetworkPacket::putRawPacket: resize m_data to datasize + memcpy
In some cases NetworkPacket was created using default constructor and m_data is not properly sized.
This fixed out of bounds memory copy
Also use memcpy instead of std::vector affectation to enhance packet creation
2017-10-10 00:47:46 +02:00
paramat
0c9ca27ffc Simple decorations: Add 'param2_max' parameter for random param2
If 'param2_max' is not used, parameter 'param2' works as before for
compatibility.
If 'param2_max' is used, 'param2' and 'param2_max' become the lower
and upper bounds of a per-decoration random param2.
2017-10-09 18:27:17 +01:00
Loïc Blot
17016090e3 Travis: Update clang from 4.0 to 5.0 (#6467)
* Update clang from 4.0 to 5.0
2017-10-09 11:32:06 +02:00
adrido
e6e5fa3bf8
Formspec: textarea with scrollbar improvements
Increase scrollrate depending on fontsize

Scroll on mousewheel

Allow scrolling and marking text on non writable textareas

Update lua api about readonly mode

Show scrollbar if text overflows
2017-10-09 08:11:03 +02:00
adelcoding1
9b8fa99fe3
FormSpec : Add an auto vertical scrollbar to the textarea 2017-10-09 08:11:00 +02:00
adrido
c830347a57 Replace deprecated WINAPI GetVersionInfoEx (#6496)
* Replace deprecated WINAPI GetVersionInfoEx
2017-10-07 15:13:13 +02:00
Rob Blanckaert
3c93a56e16 Add setting for near plane distance. (#6395)
* Allow setting the near plane

* - Add near_plane limit of 0.5 to prevent x-ray.
- Add more details to near_plane setting.
2017-10-07 15:11:48 +02:00
SmallJoker
f547452685 Unkown nodes: Provide position on interact (#6505)
* Unkown nodes: Provide position on interact
2017-10-07 15:11:07 +02:00
Vincent Glize
4e19791cde [CSM] Add callback on open inventory (#5793) 2017-10-02 22:09:49 +02:00
SmallJoker
b9fb3cea33 ParticleSpawner::step cleanup and rotation fix (#6486)
* Particles: Move spawner code to a separate fucntion
2017-10-02 20:40:59 +02:00
paramat
ee0bfbede1 CAO footstep sounds: Reduce gain to balance volume 2017-10-02 17:54:08 +01:00
paramat
e2afcf85ce Stratum ore: Allow use with no noise for simple horizontal strata
If either of the 2 noise parameters are omitted the ore will occur from y_min
to y_max in a simple horizontal stratum. As this does not compute noise
performance improves, and is ideal for placing many layers.

Clean up some nearby ore documentation.
2017-10-01 22:31:44 +01:00
Loïc Blot
9fa78b7387 game.cpp: remove dead code for proto v25 compat (#6481)
Protocol v25 is not supported anymore
2017-09-30 16:41:18 +02:00
raymoo
8c16f18fdb Fix attached particle spawners far from spawn (#6479)
* Fix attached particle spawners far from spawn

When far from spawn, attached particle spawners
did not spawn particles.
2017-09-30 15:23:51 +02:00
Loïc Blot
be10c0893e Make Player::peer_id server-side only and add getters and setters (#6478)
* Make Player::peer_id server-side only and add getters and setters

Player::peer_id has no sense client side, move it to server, make it private and add setter and getter
Also add some PEER_ID_INEXISTENT instead of harcoded 0
2017-09-30 12:00:05 +02:00
SmallJoker
f729b5d2bd Localplayer: Fix disable_jump effect and getStandingNodePos()
Leave the old move code untouched.
2017-09-28 20:36:53 +01:00
orwell96
08846cd05c Add static_save property to luaentites to not save them statically. (#5112)
* Add no_static_save property to luaentites to not save them statically.
This allows for temporary objects that would get deleted anyway as soon as they are loaded again without the static saving overhead.

* Use positive meaning for static_save object property

* Invert meaning also for the LUA parameter
Note: getboolfield() does not change &result when field does not exist, so it defaults to the default value in the header file, which is 'true'.

* Extend push_object_properties()
2017-09-28 17:11:51 +02:00
Loïc Blot
2afe62952c Server: affect bind_addr on constructor instead of start() (#6474)
bind_addr is already ready when using constructor as we read is.IPv6 from it, instead pass the whole address
2017-09-28 13:47:30 +02:00
Loic Blot
27eeb3581f
Fix some forgotten u16 -> session_t in ad7daf7b52348e1b71aa803be10de5b2134cba11 2017-09-27 23:48:12 +02:00
Paramat
0df3671a34 Fix recent commit: std::max -> std::fmax for floats (#6469)
Fixes commit a455297d297c0819a7eff89e51e5f01a5ac731c3
<cmath> header was already present in commit.
2017-09-27 23:03:41 +02:00
Loic Blot
43951cf646
Lint fix 2017-09-27 22:41:50 +02:00
Loïc Blot
ad7daf7b52 Add session_t typedef + remove unused functions (#6470)
* Add session_t typedef + remove unused functions

u16 peer_id is used everywhere, to be more consistent and permit some evolutions on this type in the future (i'm working on a PoC), uniformize u16 peer_id to SessionId peer_id
2017-09-27 19:47:36 +02:00
SmallJoker
50b2185ced Update version correctly again (#6462)
* Update version correctly again
Partial revert of PR 6331

* It doesn't update automatically
2017-09-26 20:30:42 +02:00
Loïc Blot
50423d8c72 Update JsonCPP to 1.8.3 (#6466)
* Update JsonCPP to 1.8.3

* Fix deprecated functions

Json::FastWriter, Json::StyledWriter and Json::Reader are marked deprecated since 1.1 and are deprecated in 0.8 but not shown at compilation time.

Use new methods to serialize/deserialize
2017-09-26 20:30:14 +02:00
DTA7
9eb163ab4f Add mute setting (toggled by the mute key and in the volume menu) (#6415)
* Add mute setting (toggled by the mute key and in the volume menu)
2017-09-26 08:17:50 +02:00
Loïc Blot
6f1c907204 Implement mod communication channels (#6351)
Implement network communication for channels

* Implement ModChannel manager server side to route incoming messages from clients to other clients
* Add signal handler switch on client & ModChannelMgr on client to handle channels
* Add Lua API bindings + client packet sending + unittests
* Implement server message sending
* Add callback from received message handler to Lua API using registration method
2017-09-26 00:11:20 +02:00
paramat
a455297d29 Positional sound: Limit volume when closer than 1 node
Change OpenAL distance model from AL_INVERSE_DISTANCE to
AL_INVERSE_DISTANCE_CLAMPED to avoid excessive volume when very close
to the sound location, for example MTG doors, and MTG fire sounds which
are combined at an average position and often located in air nodes.

Because AL_REFERENCE_DISTANCE has been reduced to 1 node (the distance
under which gain is clamped), multiply volume by the same factor to keep
sound gains the same as before, since the gain is calculated as:

gain = (AL_REFERENCE_DISTANCE / distance)
2017-09-25 19:09:21 +01:00
sfan5
d5a97e00ea Fix blocks written by vmanip not being marked as modified
This bug can be triggered by e.g. calling minetest.place_schematic()
and stopping the server immediately afterwards.
2017-09-23 17:09:11 +02:00
DTA7
5a3b8e34b3 Set placer to nil instead of a non-functional one in item_OnPlace (#6449)
* Set placer to nil instead of a non-functional one

This requires nil checks in core.rotate_node and core.rotate_and_place.
2017-09-21 21:52:52 +02:00
SmallJoker
67f97f8d32 on_death: Fix callback number of pushed arguments (Fixes #6451) 2017-09-21 19:56:24 +02:00
Loic Blot
080899b0f1
keycode.cpp: use std::unordered_map for keypress cache 2017-09-21 18:47:42 +02:00
jcalve
69f3c424c1 Fix compile error in openbsd (#6430)
Include the header that defines AF_INET and AF_INET6
2017-09-20 23:29:47 +02:00
paramat
d8f20d029a Leveled nodebox: Change levels from 1/63rds to 1/64ths
Add missing documentation of leveled nodebox to lua_api.txt, plus
a little cleaning up nearby.
2017-09-18 11:05:39 +01:00
paramat
27144b4716 Biome API: Revert biomes, decos, ores being relative to water level
Feature is unnecessary and would greatly complicate future development,
it would also make 'get biome at pos' extremely complex.
Mgv7: Revert option to repeat surface biomes in floatlands, which
depended on the above.
2017-09-17 05:31:48 +01:00
paramat
76817fdf98 Biome generation: Fix layers of 'filler' nodes at biome y limits
Error was exposed by commit a1389c38658fe69c3bd25c3099bae9a4e51ed401
'nplaced' was not set to U16_MAX when biome 'stone' was placed, so when
biome was recalculated in a column of stone, the 'nplaced' value
caused a few remaining filler nodes to be placed.
Occurs when the lower biome has a deeper depth of 'top' plus 'filler'
than the upper biome.
2017-09-17 03:20:20 +01:00
DTA7
45e9f80811 Correct tooltip_append_itemstring terminology (#6421) 2017-09-16 18:42:17 +02:00
Greg
45a7dd1ec4 Fix addModsFormConfig typo (#6420) 2017-09-16 18:40:19 +02:00
paramat
a1389c3865 Generate biomes: Recalculate biome at biome lower limit
Prevents biome nodes passing below the defined y_min of that biome.
2017-09-16 05:14:04 +01:00
DTA7
808ada11db Add setting to display the itemstring after the tooltip in the inventory. (#6413)
* Add setting to display the itemstring after the tooltip in the inventory.
2017-09-15 14:31:32 +02:00
sfan5
04839f233f ServerEnv: Clean up object lifecycle handling (#6414)
* ServerEnv: Clean up object lifecycle handling
2017-09-15 12:19:01 +02:00
SmallJoker
edbc533414 Customizeable max breath for players (#6411)
* Customizeable maximal breath for players
2017-09-15 12:18:47 +02:00
paramat
7640749d68 Cavegen: Avoid unsupported biome 'top' or 'filler' nodes
For 3D noise tunnels only, replace unsupported biome 'top' and 'filler'
nodes in tunnel roof with the defined biome 'stone'.
This makes terrain created by 3D noise tunnels consistent with the rest
of mapgen, which does exactly the same in this situation.
2017-09-14 04:13:47 +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
SmallJoker
5e141ac920 Network: Fix logging into older worlds with base64 hashes 2017-09-12 20:26:03 +02:00
SmallJoker
ee9a442ecc Network: Remove large parts of deprecated legacy code (#6404)
Also remove the setting 'send_pre_v25_init'
Keep old enum entries for obsolete commands
2017-09-12 19:48:09 +02:00
sfan5
7f2a19da11 Fix failing linter (travis) 2017-09-12 19:35:31 +02:00
Kahrl
17fd5fe935 Make INodeDefManager::getIds return a vector, not a set 2017-09-12 19:31:46 +02:00
Auke Kok
5b3fbf9cf7 Implement client node dig prediction
Dig prediction allows clients to remove dug nodes without
waiting for server acknowledgement.
This patch allows mods to override dig prediction,
it can either be turned off or a different "prediction node"
can be selected.
2017-09-11 20:54:20 +02:00
SmallJoker
5f489efc69 Object properties: Fix loss of custom selectionbox
Only adjust it to the collisionbox value when the collisionbox was really set.
2017-09-10 20:26:03 +02:00
rubenwardy
829bbafb27 Fix incorrect buffer size calculation on creation of HUD status messages
Fixes #6400
2017-09-10 02:53:23 +01:00
paramat
51002b1629 Schematic decorations: Add 'place_offset_y' placement parameter
For precise control of schematic vertical position relative to the
'place_on' node.
Avoids workarounds that add empty nodes to a schematic and therefore
reduce performance.

Also remove long-unused decoration cutoff code.
2017-09-10 01:31:30 +01:00
rubenwardy
557bbc6704 Fix empty legacy meta being persisted 2017-09-10 01:30:42 +01:00
SmallJoker
745a90dc84 Server: Calculate maximal total block sends dynamically (#6393)
The block sends per client is 1/2 when reaching the maximal player count.
2017-09-09 00:36:48 +02:00
SmallJoker
1105a14bcc Particles: Do not add digging particles for airlike nodes (#6392) 2017-09-08 18:39:24 +02:00
Loic Blot
151c95bb9b
main.cpp: server-only builds should not include client headers 2017-09-07 23:51:06 +02:00
Loic Blot
a3c298e1d1
Use a Buffer instead of SharedBuffer in ConnectionCommand
This fixes #6373
2017-09-05 22:14:56 +02:00
Wuzzy
f231112cc4 Make HUD status messages translatable (#5795)
* Make HUD status messages translatable

* Make strings in showStatusTextSimple translatable
2017-09-05 21:57:29 +02:00
Rui
87c5a3fb2f Remove DSTACK keybind setting (#6378) 2017-09-05 20:00:36 +02:00
paramat
115f52af86 Network protocol documentation: Add 'can_zoom' to version 36 2017-09-05 00:28:18 +01:00
Loïc Blot
40dd03e328 Implement minetest.register_can_bypass_userlimit (#6369)
* Implement minetest.register_on_userlimit_check

This new callback permits to bypass the max_users parameter with new mods condition, based on player name or IP
Only one mod needs to permit it.

Move core part for builtin privileges checks to builtin
2017-09-04 22:08:59 +02:00
Loïc Blot
c05228fa6d Re-apply previous commit with a typo fix 2017-09-04 17:37:08 +02:00
Loïc Blot
31e0f0efe9 Revert "Network: fix a concurrency problem, by re-adding a copy in ConnectionCommand"
This reverts commit 5b04f5e7d231437b534f4cad39da78624d97c584.
2017-09-04 17:28:29 +02:00
Loïc Blot
5b04f5e7d2 Network: fix a concurrency problem, by re-adding a copy in ConnectionCommand 2017-09-04 16:46:03 +02:00
paramat
a383eb0eb9 World start time: Add setting for this, default unchanged 2017-09-04 05:10:52 +01:00
you
ad9786c44b Add build date to minetest --version and increase readability (#6331) 2017-09-03 22:32:30 +02:00
Paramat
9f6d90aa81 Ores: Add stratum ore (#6352)
Creates a single undulating ore stratum that is continuous across mapchunk
borders and horizontally spans the world.
Due to being continuous is ideal for creating bands of alternative stone
type running through cliffs and mountains, or underground layers.

Add missing documentation of 'ore_param2' parameter.
2017-09-03 22:32:21 +02:00
Dharkael
5bef339388 Use member initialization list instead of the constructor's body (#6371)
* Use member initialization list instead of the constructor's body
2017-09-03 19:33:22 +02:00
Loic Blot
eabf04bd34
Network part requires SharedBuffers to be pass as value
This can trigger unreproductible crashes due to concurrency problem on SharedBuffers

This fixes #6354
2017-09-03 19:01:53 +02:00
Vaughan Lapsley
2ac5a45faa Remove 3D noise from getSteps function (#6360) 2017-09-02 18:01:13 +02:00
Rui
c0dac4d928 Remove nodeupdate completely (#6358) 2017-09-01 13:40:09 +02:00
sapier
bf403b923a Fix animation frame_speed and blend loosing precision due to incorrec… (#6357)
* Fix animation frame_speed and blend loosing precision due to incorrect data type
Add lua function set_animation_frame_speed to update the frame speed without resetting the animation to start
2017-09-01 11:15:12 +02:00
paramat
561a01cc2a Zoom: Move enabling zoom to a new player object property
Default enabled for no change in default behaviour.
Remove 'zoom' privilege.
2017-08-30 19:39:05 +01:00
Loïc Blot
bd6b90359c Remove DSTACK support (#6346)
Debugstacks is not useful, we don't really use it, the DebugStack is not pertinent, gdb and lldb are better if we really want to debug.
2017-08-30 08:09:41 +02:00
Loïc Blot
1d4a2a6ea7 Network proto handlers/container fixes (#6334)
* Fix HP transport + some double <-> float problems

TOCLIENT_HP transport u16 hp as a u8, use u16 HP, this prevent HP over 255 to overflow across network

* Fix more double/float problem in serverpackethandler & remove implicit struct type for TileAnimationParams

* Fix connection unittests container
2017-08-29 20:37:54 +02:00
Loic Blot
35a4082727
Pushing typo fix introduced in b7ee608e70f8e031e3e01c9672bedb16efa648b8 2017-08-29 20:21:14 +02:00
SmallJoker
b7ee608e70 Bump minimal protocol version to 36 (#6319)
* Bump minimal protocol version to 36
Item/Node/TileDef, NodeBox, TileAnimation: Remove old compat code

* Accept future serialisation versions
2017-08-29 19:26:55 +02:00
Loïc Blot
1b3e4e1736 Formspec: Add options to set background color and opacity (fullscreen mode + default mode) (#5493)
* Formspec: Add options to set background color and opacity (fullscreen mode)

* Enhance previous comment: Set formspec background when regenerate UI.

* This permit to do the calcul only at regen and override it with bgcolor tag
* Add a setting for default background color into formspec, separated from fullscreen
* Add a little performance gain on formspecs using a const ref instead of copying formspec string
2017-08-29 19:25:16 +02:00
you
7e38475554 mapblock_mesh.cpp: Fix code style and simplify a bit code (#4558)
* mapblock_mesh.cpp: Fix code style and simplify a bit code
2017-08-28 20:02:51 +02:00
Loïc Blot
5f38fe33f8 Clientevent refactor (#6320)
* Refactor clientevent structure

* Move structure outside of client header

* Create client events on heap not stack, this remove the ClientEvent object copy

* Use clientEventHandler to route events
2017-08-28 20:02:23 +02:00
Loïc Blot
6fd8a27c91 Pass SharedBuffer as value to increment reference count
This should fix #6332
Refcount is not increased due to reference, it can make this refcount incorrect in a multithread context
2017-08-28 17:12:46 +02:00
Dániel Juhász
04158d0c84 Use crack animation on all tile layers (#6104) 2017-08-28 07:51:55 +02:00
Nathanaël Courant
520b481383 Statbars: fix incorrect half-images in non-standard orientations (fixes #6198) 2017-08-27 19:06:40 +02:00
you
e09c7fceaa core.get_objects_inside_radius: Omit removed objects (#6318)
Fixes #6294
2017-08-27 18:38:50 +02:00
Nathanaël Courant
5a6618cc57 Add '@n' escape sequences and some documentation on translated strings. 2017-08-26 09:43:08 +02:00
Ben Deutsch
fc13c00ef3 Alternative code for slipping (#6256)
* Alternative code for slipping

- does not depend on frame rate
- controllable via environment variables for now

* Adjust slipping speed for item entities too.

* Final version of framerate-independent slippery code

* Remove dead code and fix formatting

* getStandingNodePos should only look 0.05 nodes downwards

This ensures that, even if the player is standing on a partially
filled node, this node is used as the standing node and not the
node below it.

Specific use: enables slippery slabs

* Exchange global getStandingPosNode change for local inline change

Reverts previous commit

* Revert the item movement changes

* Slippery nodes now slip over cliffs and edges

Players no longer suddenly stop before falling off.
Also refactored slippery code into getSlipFactor method.

* Slipping over an edge gated by player's is_slipping state

A new flag for just this case, to reduce costly node lookups in
the normal case of leaning over a non-slippery edge.
Public access for consistency and potential future uses.

* Minor code tweaks / cosmetics

* Add temp variable to improve readability and fix indentation issues
2017-08-26 09:01:09 +02:00
Paramat
0e0643df35 Android stepheight: Only increase if 'touching ground' (#6313) 2017-08-26 08:45:09 +02:00
Paramat
e55aeec2e2 Mgfractal: Use 'switch case' instead of 'if else' (#6314) 2017-08-26 08:43:50 +02:00
rubenwardy
ad9677a14f Check item_drop amount clientside (#6242) 2017-08-26 08:11:59 +02:00
Loïc Blot
3cea7a349a Network cleanup (#6310)
* Move Connection threads to dedicated files + various cleanups

* ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types
* Various code style fixes

* Code style with clang-format

* Various SharedBuffer copy removal

* SharedBuffer cannot be copied anymore using Buffer
* Fix many SharedBuffer copy (thanks to delete operator)
2017-08-25 15:53:56 +02:00
Dániel Juhász
f6a33a1a7a Overlays for wield and inventory images (#6107)
* Overlays for wield and inventory images
2017-08-25 13:20:53 +02:00
Ekdohibs
6761e21383 Translations: prevent remote crash with invalid translations 2017-08-25 13:06:59 +02:00
Ekdohibs
b24e6433df Add clientside translations. 2017-08-24 17:54:10 +02:00
adrido
017840f9b1 Dont define min/max macros in minwindef.h (#6308) 2017-08-24 17:13:53 +02:00
Pavel Puchkin
caf61f3b4d Fix OSX builds caused by __WORDSIZE again (#6307) 2017-08-24 10:02:23 +02:00
stujones11
ac4884c3d6 Make entity selection and collision boxes independently settable (#6218)
* Make entity selection and collision boxes independently settable
2017-08-24 10:01:16 +02:00
Dániel Juhász
01c319d778 Fix Android node selection distance (#6187) 2017-08-24 08:31:33 +02:00
Ben Deutsch
397a701f98 Safe digging and placing (#6127)
* Setting: Safe digging and placing

* New setting 'safe_dig_and_place' under Controls
* If set, digging and placing will not auto-repeat
* Releasing buttons unblocks the respective action again
* Useful for inexperienced users in creative mode where default
  repeat times may be too short

* Safe placing (right click repetition) does not need a guarding flag

* Added new setting to minetest.conf.example
2017-08-24 08:30:46 +02:00
Loïc Blot
c7160cb629 Network cleanup (#6302)
* Cleanup network headers

* Move peerhandler to a specific header to reduce compilation times
* Move socket.cpp/h to network folder

* More work

* Network code cleanups

* Move socket.{cpp,h} to network folder
* Move Address object to network/address.{cpp,h}
* Move network exceptions to network/networkexceptions.h
* Client: use unique_ptr for Connection
* Server/ClientIface: use shared_ptr for Connection

* Format fixes

* Remove socket.cpp socket.h from clang-format whitelist

* Also fix NetworkPacket code style & make it under clang-format
2017-08-24 08:28:54 +02:00
Pavel Puchkin
928609c8bd Fix OSX builds (closes #6289, fixes #6270) (#6306)
Of course, this is not ideal solution, but we want our users to be happy in the
first place, right?
2017-08-24 07:58:12 +02:00
SmallJoker
f7d50a8078 Respect object property hp_max field for players (#6287)
* Respect object property hp_max field for players
This allows modders to configure the maximal HP per player

* Statbars: Downscale bar to full 20 HP when exceeding this value
Add default max HP for players and breath constants to builtin
Document the constants

* Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT
2017-08-23 22:32:10 +02:00
stujones11
d01b65abeb Do not add base position to player selection box (#6241) 2017-08-23 14:18:44 +02:00
Loïc Blot
e2a6b7c8d2 serialize: use a temporary for SerializeException
Exception must always use temporary instead of global copied exception instances, it's not recommended and should have undefined issues
2017-08-21 16:07:39 +02:00
paramat
1dd535c0c6 Mgv6: Remove incorrectly defined and unused 'volume nodes' 2017-08-20 23:59:02 +01:00
paramat
7657fe7a50 Minimap: Add new HUD flag for minimap radar mode
Flag default is true to not change default behaviour.
The existing minimap HUD flag remains the master control for minimap.
2017-08-20 23:58:15 +01:00
Loic Blot
a3441638c6
Fix a formspec crash triggered by ae9b5e00989756bb676429530dfe81039009001c 2017-08-20 20:24:26 +02:00
Jens Rottmann
9d8cb510b3 Change BS constant from implicit double to float (#6286)
the BS constant
implicitly promotes all position calculations it is used in to double even
though positions (= v3f) are only meant to be floats.

There are many, many similar occurrences everywhere, but I'm not willing to
hunt down all; I only fixed the little part I'm already familiar with.
2017-08-20 19:37:55 +02:00
Loïc Blot
ae9b5e0098 Modernize code: very last fixes (#6290)
Last modernization fixes
2017-08-20 19:37:29 +02: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
Loïc Blot
50669cd282 Fix shader.h inclusion place in game.cpp 2017-08-19 22:24:30 +02:00
Loïc Blot
88b436e6a9 Code modernization: subfolders (#6283)
* Code modernization: subfolders

Modernize various code on subfolders client, network, script, threading, unittests, util

* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* C++ STL header style
* Make connection.cpp readable in a pointed place + typo
2017-08-19 22:23:47 +02:00
Loïc Blot
7528986e44 Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial)

* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* C++ STL header style
* Spelling: vertice -> vertex
2017-08-19 14:25:35 +02:00
Loïc Blot
1992db1395 Code modernization: src/n*, src/o* (#6280)
* Code modernization: src/n*, src/o*

* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* remove unused IWritableNodeDefManager::clone()
* C++ STL header style
* Pointer constness in some functions
2017-08-19 11:30:46 +02:00
SmallJoker
4a1265ceb5 GenericCAO: Fix light position for non-players, remove deprecated initialisation code (#6281) 2017-08-19 11:30:09 +02:00
Loïc Blot
de4c2e4250 ServerMap saving: cleanups (#6274)
* remove sector meta loading/saving from files which targets dead code (differs_from_disk is always empty)
* this remove empty ServerMapSector and ClientMapSector, remove MapSector childs
2017-08-19 11:29:46 +02:00
Loïc Blot
b82884aa62 ItemCAO removal (#6279)
This object is from 0.3 era and was never used since 0.4.X and GenericCAO usage
2017-08-19 09:30:43 +02:00
Loic Blot
d382483fa7
Code modernization: src/m* (part 3)
* empty function
* default constructor/destructor
* for range-based loops
* use emplace_back instead of push_back
* remove some unused headers in some cpp variable
2017-08-19 09:29:55 +02:00