Commit Graph

5839 Commits

Author SHA1 Message Date
ANAND e8fd1ce623 Replace stray tab with whitespace in guiFormSpecMenu.cpp (#9317) 2020-01-18 16:50:57 +00:00
Hugues Ross 680aaa1bd5 Make clipping of formspec elements more consistent (#9262) 2020-01-16 18:41:07 +00:00
lhofhansl cea4fd2b27 Increase star count to 1000 and decrease radius slightly (#9307)
* Increase star count to 1000 and decrease radius slightly.
* Adjust star width.
2020-01-16 17:12:34 +01:00
Maksim c396800629 Android: fix cyrillic characters, update iconv lib (#9117) 2020-01-13 07:10:15 +01:00
Montandalar 8d75c118d9 Map download: Escape ':' to '_' (#9235)
This is necessary under Windows systems, and direct IPv6 connections.
Windows universally disallows ':' from occuring in filenames.

Other disallowed characters on Windows:

	\ / * ? " < > |

are not relevant to hostnames, IPv4 or IPv6 addresses.

Anyone who has got an existing server map saved on Linux with ':' in
the world save will want to keep that save.
2020-01-11 20:47:34 +01:00
DS 4c8af5492b Formspec: change the appeareance of the cursor on fields and co. (#8665) 2020-01-11 20:17:11 +01:00
DS 7c0e0c34ec Formspec: Fix clicking on tooltip-obstructed elements (#9266) 2020-01-04 15:45:22 +01:00
Paramat c162340973
Remove Mapgen V7 floatlands in preparation for new implementation (#9238)
Preserve the floatland flag of existing worlds, to be used again
when the new implementation is added.
2020-01-04 01:23:57 +00:00
Montandalar 44458896d9 Use appropriate LC_ locale macro for Windows (#9230)
* Wrap LC_ macro in ifdef

Windows does not have LC_MESSAGES in locale.h, so use LC_ALL on that platform
2019-12-24 19:13:22 +01:00
Lejo 37f771a95b Fix the player information version_string return value (#8616)
* Give more player information

* Correct lua_api.txt

* Correct keys in lua_api.txt

* Improve Code

* Only Bugfix+ser_vers

* Correct doc

* Fix double
2019-12-20 19:16:29 +01:00
Hugues Ross b50dc43f67 Don't override the FGIMG style property if the image parameter is null 2019-12-16 19:26:57 +01:00
Hugues Ross e42faae8d9 Remove the dependency on FGIMG/BGIMG from the hovered/pressed variants
- Make guiButtonImage support null images properly
2019-12-16 19:26:57 +01:00
Hugues Ross bd4b8d40b3 StyleSpec: 0-initialize the property_set array 2019-12-16 19:26:57 +01:00
SmallJoker c3d0aab0bc GUIFormSpecMenu: Fix legacy sorting using std::stable_sort 2019-12-14 21:28:07 +01:00
rubenwardy 8e63d22d64 Fix spaces breaking formspec_version[] tag 2019-12-09 21:05:07 +00:00
Hugues Ross 9284313d17 Refactor to centralize GUIButton styling/rendering code (#9090) 2019-12-09 20:06:51 +00:00
SmallJoker a462181e5f guiConfirmRegistration: Fix hidden error message 2019-12-09 20:01:16 +01:00
DS 8f73ec6c6c Formspec: make bgcolor element less confusing and allow setting fullscreen color (#8996) 2019-12-08 18:59:30 +01:00
Paul Ouellette 27ce6d0ecc Clean up craft replacements docs 2019-12-07 23:46:24 +01:00
SmallJoker 103d9c5c53 Renaming the function wasn't enough 2019-12-07 15:55:49 +01:00
SmallJoker aa8df112ff Attachments: Fix interpolation from (0,0,0) after detach
GenericCAO::getPosition() did not take the camera offset into account
LocalPlayer attachment cleanup: Use sane getParent() function
Make that getPosition() (GenericCAO and LocalPlayer) always return the absolute position
2019-12-07 15:12:26 +01:00
rubenwardy 51f230895c Fix failing build due to code style error 2019-12-06 23:00:54 +00:00
v-rob 4f45bfd08b Add scrollbaroptions FormSpec element (#8530) 2019-12-06 20:51:10 +00:00
Pierre-Yves Rollo cf7fda0083 Add z-index management to HUD 2019-12-06 20:31:26 +00:00
SmallJoker f6de86ce4b Fix LocalPlayer-bound sound playback broken by 81c2370 2019-12-05 20:52:30 +01:00
sfan5 0b2f0914cc Improve client-side packet receiving 2019-11-25 20:00:24 +01:00
paramat 154080c883 Caves: Fix shadowing of 'large_cave_depth' to avoid confusion 2019-11-23 01:41:27 +00:00
paramat ec5f591014 Dungeons: Move duplicated y limit checks to generation function 2019-11-23 01:41:27 +00:00
SmallJoker b50a166bb0
Formspec: Fix priorities for version < 3 (#9121)
* Formspec: Fix priorities for version < 3

1) Introduce 'priority' to 'FieldSpec'
2) Sort elements based on 'priority'
3) Assign 'name' to the Item Image Button's image to show tooltips again
2019-11-20 19:39:10 +01:00
Lars Hofhansl 60bff1e6cb Waves generated with Perlin-type noise #8994 2019-11-19 19:42:52 -08:00
Paramat b3c245bb46
Move duplicated mapgen parameters to class MapgenBasic (#9134)
'large_cave_depth', 'dungeon_ymin' and 'dungeon_ymax' are duplicated across many mapgens so should have been in class MapgenBasic from the start.
2019-11-19 19:59:17 +00:00
sfan5 c10952b574 Rework packet receiving in ServerThread
Notably it tries to receive all queued packets
between server steps, not just one.
2019-11-19 20:27:20 +01:00
Paramat 97764600e2
Randomwalk cave liquids: Remove deprecated 'lava depth' parameter (#9105)
Low-disruption first step towards removing the hardcoded cave liquid
code. Since MT 5.0.0 cave liquids can be defined and located by
biome definitions instead.
In games that do not yet use biome definitions to define and locate
cave liquids (MTGame does), lava will now appear below
y = water_level - 256 instead of below 'lava depth' (usually y = -256).
Therefore no change in most mapgens if using the default 'lava depth'.
2019-11-18 23:40:01 +00:00
sfan5 49365b25d9 Optimize semaphore wait with zero timeout on POSIX 2019-11-14 20:20:14 +01:00
sfan5 02111e4961 Fix clang-tidy and lint travis checks 2019-11-11 14:06:48 +01:00
sfan5 c44318a253 [CSM] Fix and improve minetest.get_language()
Previously this method would accidentally reset the locale
and break everything.
2019-11-11 14:06:48 +01:00
sfan5 2c4cf508a9 [CSM] Implement minetest.get_csm_restrictions()
fixes #8068
2019-11-11 14:06:48 +01:00
sfan5 3f271564e0 Run on_item_use CSM callback even if item is not marked usable
Mods may want to to handle item interaction even if the item
is not marked usable (= server-side callback exists).
2019-11-11 14:06:48 +01:00
sfan5 682b9de824 Fix camera:get_offset() in CSM 2019-11-11 14:06:48 +01:00
sfan5 b57dc70769 [CSM] Expose more env functions 2019-11-11 14:06:48 +01:00
sfan5 b0260b5ec8 Refactor CSM restriction code a bit
This also fixes find_node_near restrictions being ineffective.
2019-11-11 14:06:48 +01:00
sfan5 4d668f32a6 Call on_secondary_use when object is right-clicked 2019-11-10 13:12:31 +01:00
Paramat 3b0df9760b
Randomwalk caves: Extend beyond mapchunk vertically also (#9094)
Previously, randomwalk caves only extended beyond the mapchunk
borders horizontally, preventing vertical overlap and
interconnection.
2019-11-10 01:41:20 +00:00
sfan5 d961ece144 Be lenient with extra slashes for CSM paths 2019-11-09 16:08:38 +01:00
sfan5 485b669840 [CSM] Remove non-functional minetest.get_day_count() 2019-11-09 16:08:38 +01:00
sfan5 7e649f985c Corrections to client_lua_api.txt 2019-11-09 16:08:38 +01:00
sfan5 b1f2a69382 Introduce get_modpath() for CSM 2019-11-09 16:08:38 +01:00
sfan5 82a2e02323 Load client mods into memory before execution.
Preperation for server-sent CSM which will eventually need this.
2019-11-09 16:08:38 +01:00
sfan5 5ab546f99b Refactor loading of Lua code with mod security 2019-11-09 16:08:38 +01:00
Paramat 29a4a8e5af
Tunnels: Completely disable generation when 'cave width' >= 10.0 (#9093)
Previously, the only way to disable the 3D noise tunnels was to set
'cave width' > 1.0, however doing so did not disable the very intensive
noise calculations or the generation loop.
All the other types of cave generation (randomwalk caves, caverns)
can already be independently and completely disabled.
This feature is now needed more because the small randomwalk caves are
now available for use as an alternative to the 3D noise tunnels.
2019-11-09 02:09:52 +00:00
Paul Ouellette d11bfa3ef5 Make core.get_favorites("local") ignore duplicates (#7926) 2019-11-08 22:18:20 +01:00
Paramat 2a74727857
Randomwalk caves: Add parameters for number, proportion flooded. Allow small caves (#8928)
Add mapgen parameters to set the range of the random number of
randomwalk caves per mapchunk, and to set the proportion that are
flooded with liquids.
Default values are, for now, unchanged from the previous hardcoded
values.

Add parameters to allow small randomwalk caves
Disabled by default for now as they have never been present in the
non-mgv6 mapgens.
2019-11-08 03:09:43 +00:00
DS 5506e97ed8 Formspec: draw order and clipping for all elements (#8740) 2019-11-07 20:11:01 +01:00
SmallJoker 2907c0f3a2 Android: Fix broken double-tap after 49 days uptime 2019-11-03 12:59:12 +01:00
SmallJoker 388ea737f5 Clean up font caching, fix bitmap fonts 2019-11-03 11:45:33 +01:00
Pierre-Yves Rollo 72416a6a1f Formspec: add hypertext element 2019-11-03 11:45:33 +01:00
random-geek f2e62298a5 Change some usages of "deprecated" to "obsolete" (#9062)
"Deprecated" means that something is still in use, but is unsupported and needs to be removed.
"Obsolete" means it is already out of use.
2019-10-29 19:23:12 +01:00
random-geek 53ebd803c6 Change some rough/inappropriate language in comments (#9061) 2019-10-24 01:17:00 +01:00
Paramat 1f142ec06f
Improve light curve parameter limits and documentation (#9054)
Revert gamma upper limit to 3.0 because that was raised based on
a misunderstanding and had no benefit. A sane upper limit is
needed as players on a competitive server tend to use the maximum.
Set gamma lower limit to 0.33 for consistency with 3.0.
Set sane limits on alpha, beta, boost and enforce these in code
to limit values entered in minetest.conf and to avoid easy cheating
by editing settingtypes.txt.
Improve documentation and 'readable' setting names.
Clarify that gamma does not significantly affect natural night light.
light.cpp: Various codestyle and comment improvements.
2019-10-24 01:08:49 +01:00
random-geek 2f3c96b38d Remove legacy flat-file map code 2019-10-23 20:53:24 +02:00
Dmitry Marakasov 2ecf57c640 Fix build issue due to conflicting s64 type definitions (#9064)
See comment in irrlichttypes.h and https://sourceforge.net/p/irrlicht/bugs/433/
2019-10-23 20:28:55 +02:00
Paul Ouellette 904b05b0d3 Allow calling ItemStack with no arguments (#8783) 2019-10-23 19:48:19 +02:00
SmallJoker a978278bfb Formspecs: Reset version number on rebuild 2019-10-20 12:44:52 +02:00
Paramat 79440605ec
Make natural night light as bright as MT 0.4.16 (#9053) 2019-10-18 21:54:44 +01:00
Warr1024 15b6922ae6 Correction for alpha blending issues in texture mod compositing (#9029) 2019-10-18 19:17:35 +02:00
Paramat 47d0779365
Randomwalk caves: Reduce 'insure' value from 10 to 2 (#9035)
This value reduces how far randomwalk caves can extend into the
mapchunk padding, to avoid 'out of voxelmanip' cave nodes which cause
flattened cave walls.
Testing shows that a value of 2 (instead of 10) is enough to make
'out of area' nodes extremely rare.
Reducing this value results in a higher chance of overlap and
connection with caves of neighbour mapchunks.
2019-10-13 00:18:23 +01:00
Hugues Ross 69a2099c04 Add more visual feedback for button states (#8916)
- Add style properties for overriding the the hovered/pressed state
  - By default, hovered buttons are a lighter version of the base color
  - By default, pressed buttons are a darker version of the base color
- Add hovered bg image support for image buttons (style property)
2019-10-12 18:44:23 +02:00
updatepo.sh 22e04d9919 Update translation strings 2019-10-12 14:29:24 +02:00
Paramat f483a1a9b2
Fix isDead()/autoforward crash (#9031)
Crash occurred in singleplayer when leaving a world with
autoforward enabled then re-entering a world.
2019-10-09 19:39:50 +01:00
SmallJoker cbcb9e0b1c ContentCAO: Fix segfault on quit (attached) 2019-10-09 20:03:31 +02:00
ANAND b49dfa92ce Revert Client::sendPlayerPos optimization (part of 81c7f0a) (#9025)
Comment out the if statement that prevents sending TOSERVER_PLAYERPOS if the player is dead.
2019-10-08 20:36:56 +02:00
sfan5 825579b43d Fix upright_sprite lighting when colors are set
fixes #9020
2019-10-06 17:19:42 +02:00
SmallJoker dee22104b7
Revert "Fix the bgcolor formspec element (#8716)" (#9018)
This reverts commit 1db3d252cf.
Temporary solution until a compatible solution is found to define both - formspec and fullscreen backgrounds.
2019-10-06 14:50:45 +02:00
sfan5 dde0628976 Fix warnings in guiButton.h 2019-10-05 18:15:26 +02:00
Jacob Lifshay 76032159bd Fix unwanted detaching when damage = 0 2019-10-05 15:45:05 +02:00
SmallJoker 81c2370c8b
Attachments: Fix attachments to temporary removed objects (#8989)
Does not clear the parent's attachment information when the child is deleted locally.
Either it was removed permanently, or just temporary - we don't know, but it's up to the server to send a *detach from child" packet for the parent.
2019-10-02 19:11:27 +02:00
SmallJoker 61e9c1b0dd
Textures: Load base pack only as last fallback (#8974) 2019-09-29 19:57:29 +02:00
SmallJoker c2458d3d3a label[]: Fix broken colors since 2c9edef 2019-09-29 14:52:41 +02:00
ANAND 3799ffd9d5 Move Quicktune code to util/ (#8871) 2019-09-29 13:41:13 +02:00
rubenwardy 07bdd6049b Fix error message caused by adding new parameter to background (#8922)
Adds background9[] element to keep backwards compatibility in formspec prepends.
2019-09-29 13:40:59 +02:00
lhofhansl 5fde69798c
Simple shader fixes. (#8991)
1. Pass current camera offset to shader, so shader have access to the global coordinates
2. Pass animation timer to fragment shader. C++ code is already there, just wasn't declared in the shader
3. Delay animation timer wrap-around (from 100s to about 16 minutes)
2019-09-26 13:57:39 -07:00
SmallJoker 26b39f1eae
Fix some reference counters (memleak) (#8981)
Fix some reference counters (memleak)
Map::dispatchEvent: Allocation safety using references
2019-09-24 19:05:28 +02:00
sfan5 d77ea76476
Fix broken build
The variable name changed but this didn't cause merge conflicts, so it wasn't caught before.
2019-09-23 00:28:26 +02:00
DS-Minetest cf78e37da3 Move the code for meta formspec into bool Game::nodePlacement(const ItemDefinition &selected_def, 2019-09-22 22:12:49 +02:00
sfan5 70f9e1aafa
Punchwear (improved) (#8959) 2019-09-22 22:12:21 +02:00
SmallJoker fec30e37ac
Fix AreaStore's IDs persistence (#8888)
Improve documentation
Read old formats
Fix free ID function. Return first gap in map
2019-09-21 17:54:52 +02:00
SmallJoker 5fa614d97e
Wieldhand: Specify which ItemStack to use (#8961)
Makes 'get_wield_item' to return the "main" ItemStack
2019-09-21 11:44:24 +02:00
Anand S 47da640d77 Add support for per-player FOV overrides and multipliers 2019-09-19 20:14:16 +02:00
sfan5 5c9983400f Remove incorrect MutexAutoLock
The line declared a variable "m_con" instead of locking m_con.
getClient() doesn't need this anyway, so remove it.
2019-09-19 16:46:41 +02:00
DS-Minetest 0b5c5499ec Trigger on_place in many situations even if prediction failed 2019-09-19 16:36:02 +02:00
SmallJoker 4271889ef8 Settings: Prevent mutex deadlock in remove() (#7803) 2019-09-18 18:48:41 +02:00
SmallJoker 94a5df795c
Inventory: Properly revert client predictions (#8945)
Caused by incremental inventory sending
Previously everything was overwritten by serializing the entire inventory
2019-09-18 18:47:09 +02:00
Hugo Locurcio 05a7da6279 Improve undersampling settings
The setting now accepts values between 1 and 8 in the
Advanced Settings menu.
Values 0 and 1 now behave the same way (setting it to 1 won't
disable MSAA anymore), so there's no need to expose 0 as a value.

This closes #8939.
2019-09-17 19:06:51 +02:00
SmallJoker e0a85fae01 Inventory: Undo prediction on drop 2019-09-17 19:02:01 +02:00
DS 1db3d252cf Fix the bgcolor formspec element (#8716) 2019-09-15 17:14:31 +01:00
rubenwardy 1ea9bfc6f7 Fix formspec version backup in prepends losing data 2019-09-15 16:56:11 +01:00
Paramat 23bd5630d0
Dungeons: Clean up parameters, improve structure variety (#8918)
While preserving the general character of dungeon structure.
Slightly increase the range of standard room horizontal size, while
preserving the average horizontal size.
Return to classic maximum large room size of 16x16x16.
Make 1 in 4 dungeons have a 1 in 8 chance for each room being 'large',
making multiple large rooms possible for the first time.
Make 1 in 8 dungeons allow diagonal corridors, to make these a little
more common.
Make corridor width vary from 1 to 2, but forced to 2 if diagonal
corridors are allowed, to make them passable.
Add some comments.
2019-09-14 23:02:07 +01:00
SmallJoker 1de4ca1f9d Built-in formspecs: Force version 1 2019-09-14 20:42:54 +02:00
ANAND 8e42a25e57 client.h: Add missing const's 2019-09-14 20:16:55 +02:00
ANAND 16d6ca3937 LocalPlayer: Fix code-style 2019-09-14 20:16:55 +02:00
ANAND eea082ee3f client.cpp: Fix code-style in Client::sendPlayerPos 2019-09-14 20:16:55 +02:00
ANAND e2d6445f2a Fix LocalPlayer::isDead always returning false if player is immortal 2019-09-14 20:16:55 +02:00
ANAND 81c7f0ae04 Send ActiveObjects once right after Init2 2019-09-14 20:16:55 +02:00
SmallJoker 9acd36bf99 Formspecs: Introduce formspec_version to mods 2019-09-14 19:43:08 +02:00
SmallJoker b0baa698a4 CSM: Fix itemstack:get_meta() 'metadata' indexing error 2019-09-14 19:42:30 +02:00
SmallJoker 23677be951 Load CSM environment after the restrictions are known
Safety-guards for CSM callbacks to abort on a bad implementation
Only run callbacks when the mods are loaded (and with it: builtin)

Duplication checks inside constructors
2019-09-14 19:42:25 +02:00
SmallJoker 720aedb467 InventoryManager: Fix virtual function overload warning 2019-09-09 20:35:45 +02:00
SmallJoker fae6242d4e Send cumulated inventory changes only each step (#8856)
Applies to player and detached inventories
2019-09-09 19:19:54 +02:00
updatepo.sh ae92bbe508 Update translation strings 2019-09-09 19:18:30 +02:00
Paramat 4682c7be5d
Dungeons: Remove non-functional 'projecting dungeons' setting (#8897) 2019-09-08 17:51:34 +01:00
HybridDog 36bfc67574 Move debug.txt after it grows too big (#8904)
Before opening the file for writing, its file size is tested. If it exceeds 50 MB, it is moved to debut.txt.1, otherwise the log is appended to the old messages. An old debut.txt.1 is removed if it already exists.
2019-09-07 19:38:54 +02:00
SmallJoker 2c9edefde3 label[]: Fix cut-off translated text 2019-09-07 11:15:12 +02:00
sfan5 ea9b241c13 Fix Irrlicht 1.9 support 2019-09-06 18:29:29 +02:00
sfan5 4582691104 Fix Inventory::moveItemSomewhere() 2019-09-03 20:16:36 +02:00
SmallJoker f3acdd3914
Inventory: Handle removeItem leftovers (#8884) 2019-09-02 19:30:36 +02:00
Muhammad Rifqi Priyo Susanto cd1d01b8b4 'All Settings': Don't use checkboxes for 'no...' mapgen flags (#7847) 2019-09-01 22:43:41 +01:00
ANAND 095f26a4f8 particles.cpp: Fix code-style
Mainly spacing and pointer placement
2019-08-31 19:05:53 +02:00
ANAND 96762af3ce clientobject.h: Fix code-style 2019-08-31 19:05:53 +02:00
Pedro Gimeno 9543b84970 Fix rotation of attached particlespawner
Co-authored-by: ANAND <ClobberXD@gmail.com>
2019-08-31 19:05:53 +02:00
SmallJoker 1d3f5af7c0 Inventory: Fix missing setModified calls
Previously inv:remove_item and inv:set_list did not trigger an inventory update
2019-08-25 09:46:54 +02:00
Paramat b53a60c8d5
Mapgen v6: Various mudflow code improvements and bugfixes (#8805)
Calculate 'i' inside 'y' loop to avoid 'i' and 'y' becoming
out of step due to the uses of 'continue'.
Simplify calculation of 'p2d' when coordinates are inverted.
Remove some unnecessary and unreliable 'index out of
voxelmanip' checks.
Move calculation of '&em' out of loops.
For 'Loop further down until not air' code, use y coordinate
to detect being out of voxelmanip, instead of checking index
which did not detect that.
Add and improve comments.
Indent the 'for (;; y--) {' loop.
Improve format and fix codestyle issues.
2019-08-24 20:06:31 +01:00
SmallJoker fbc8724d59 fontengine: Fix non-gettext builds 2019-08-24 19:11:50 +02:00
SmallJoker 0b4f424f41
Inventory: Send dirty lists where appropriate (#8742)
This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time.

Raises protocol version to 38 to ensure correct backwards-compatible code.
2019-08-24 19:07:38 +02:00
Paul Ouellette 008b80fe1c Add ItemStack:get_description() to get tooltip (#8847) 2019-08-24 18:38:02 +02:00
sfan5 efbac7e446 Improve occlusion culling in corridors with additional check 2019-08-24 18:37:25 +02:00
sfan5 e8716ffede Restore approximate occlusion check
While less precise, it worked better which is what matters in the end.
2019-08-24 01:41:55 +02:00
DS b14aa305ce Make Mapgen::spreadLight use a queue (#8838) 2019-08-23 22:16:50 +02:00
SmallJoker 6ada090bb0 Occlusion: Check for light_propagates and do mapblock bounds checks 2019-08-23 19:17:43 +02:00
SmallJoker 7d016b4efd Occlusion: Begin cleanup 2019-08-23 19:17:43 +02:00
sfan5 ba8fb774c1 Revert "Don't send position update packet if player is dead"
This reverts commit fb6f1fdcbe.
2019-08-21 15:30:52 +02:00
SmallJoker b8131c3415 remove_detached_inventory: Fix segfault during mod load 2019-08-20 19:42:21 +02:00
ANAND fb6f1fdcbe Don't send position update packet if player is dead 2019-08-20 18:49:06 +02:00
ANAND 3c395d908f Disable autoforward if player is dead 2019-08-20 18:48:28 +02:00
theviper121 ded5da7800 Restore intended functionality to minimap markers (#8819) 2019-08-19 19:18:11 +02:00
SmallJoker d73e458db6
ClientInterface: Use recursive mutex to prevent freeze in on_newplayer() (#8808) 2019-08-17 13:27:28 +02:00
sfan5 13b22e2afb Remove unused function in ReliablePacketBuffer 2019-08-16 20:03:53 +02:00
sfan5 428a4c86e3 Minor refactor of IncomingSplitBuffer 2019-08-16 20:03:53 +02:00
sfan5 fc2f55d931 Drop m_list_size from ReliablePacketBuffer
It's not required and, worse, can lead to bugs.
2019-08-16 20:03:53 +02:00
Paramat d7c10b66d3
Mapgen v6: Fix mudflow iteration and iterate twice (#8795)
In MapgenV6::flowMud(), the previous implementation of coordinate
inversion caused the 2 inverted mudflow iterations (out of the 3
iterations) to not loop over the area, so only 1 non-inverted
iteration occurred.

Fix this bug but only iterate mudflow twice, as mapgen v6 has only
had 1 iteration for many years. There is now a good balance of 1
non-inverted iteration and 1 inverted iteration.
2019-08-15 20:32:28 +01:00
sfan5 2db0e93f73 network: Stricter handling of split packets 2019-08-15 20:15:22 +02:00
sfan5 c4491165da network: Fix crash in ReliablePacketBuffer on mismatching packets
In the error condition the exception would be thrown before m_list_size
is decremented, causing a nullptr dereference in e.g. popFirst().
2019-08-15 19:18:54 +02:00
upsilon b2065756cf Add function `minetest.read_schematic` 2019-08-14 13:15:41 +02:00
Jozef Behran bf22184d6e Fix unnecessary exception use in 3 more methods (#8791)
* Fix unnecessary exception use in Server::SendBlocks

The code in this method calls getBlockNoCreate and then
messes around with try...catch to skip blocks which are not
in the memory. Additionally, it repeatedly calls
m_env.getMap() inside this loop. Speed the code up by
extracting the m_env.getMap() out of the loop and getting
rid of the try...catch.

* Fix unnecessary exception use in Server::SendBlock

Another unnecessary try...catch is slowing down
Server::SendBlock. Remove that to speed it up and get a nice
side effect of simplifying the code in question.

* Fix unnecessary exception use in MMVManip::initialEmerge

Remove another unneeded exception usage from
MMVManip::initialEmerge to speed that code up and simplify
it but be careful to not remove the braces as there is a
TimeTaker in use there.
2019-08-13 20:02:50 +02:00
Jozef Behran 72b7a957af Fix unnecessary exception use in Map::getSectorXXX (#8792)
The Map::getSectorNoGenerate throws an exception but no other
code is really dependent on that. Fix the odd instance of
misuse in ClientMap::emergeSector and remove the exception
throwing version of the method along with the "NoEx" suffixes
in the names of these methods.
2019-08-13 19:58:27 +02:00
SmallJoker 539f016c1b
Better F6 profiler (#8750)
Update the profiler names to make more sense of what they actually represent
Move the profiler code from header to its source file
Use monospace font to align lines
Format the statistics line to align better with surrounding values
Refresh the profiler each 3 seconds (roughly)
2019-08-13 19:56:55 +02:00
Jozef Behran e9ceead81d Fix unnecessary exception use in Map::isNodeUnderground
The isNodeUnderground calls getBlockNoCreate which calls
getBlockNoCreateNoEx and throws InvalidPositionException
if the returned value is nullptr, which isNodeUnderground
then catches to return "false". Remove the try..catch in
isNodeUnderground by calling getBlockNoCreateNoEx instead
of getBlockNoCreate and checking the returned value for
nullptr.
2019-08-13 19:40:59 +02:00
Jozef Behran 833e60d8d2 Fix compare between pointer and 0 in unittests
Pointers shall be set to nullptr, not 0, according to the
coding standards. By implication they shall be compared with
nullptr, not 0, too. Fix this code to match that.
2019-08-13 14:44:32 +02:00
Beha 2f879e8bbd Clear old item groups when they are overridden. (#8753)
This fixes overridden items keeping their old groups in the group to
items mapping even after their groups have been changed in lua.
It also prevents a more widespread issue where overriding an item
will add its content ID *twice* to the mapping, resulting in odd
behaviour in features such as ABMs.
2019-08-12 19:18:52 +02:00
rubenwardy 91114b562f Add support for set_formspec_prepend in main menu (#8611) 2019-08-12 19:16:35 +02:00
Rogier a067d40454 Handle multiple deserialization of a block's entities
This fix consists of two parts:
- Clear the list of stored entities. This has no side-effects.
- Catch the case where active entities exist and print a message.
  Clearing the active entitiy list has side-effects that should
  be handled. (those entities are known to the environment and
  to clients).

  As avoiding those side-effects is more complex, and as this
  problem is not expected to occur (with PR #4847 merged), there
  is no real incentive to implement this ATM.

This issue was a contributing factor to bug #4217. With the other
contributing factor removed (PR #4847), this commit makes sure this
factor does not go unnoticed if it ever happens again.
2019-08-12 19:14:07 +02:00