6597 Commits

Author SHA1 Message Date
Vincent Glize
aa2fb725a0 [CSM] Add event on_place_node API lua (#5548)
* [CSM] Add event on_place_node API lua
2017-04-29 12:08:16 +02:00
Loic Blot
482d798286 Fix Lint broken by b662a4577d692329b9ca83525e6039f2ddcd1ac1 2017-04-29 09:47:22 +02:00
Auke Kok
cb0a28b44b Reorder TileLayer. (#5638)
Despite the split of TileSpec into TileDef and TileLayer, the
TileLayer struct is still 66 bytes large, and doesn't fit in
a single cacheline.

I'm moving the color member to cacheline 2, in the hope that it
is less used and the compiler loads all the hot members in a single
cacheline instead. Only color sits now in cacheline 2, all the
other members are in cacheline 1.

Note: is_color is probably rarely set, most nodes will likely
not use hardware coloring, but this may change in the future.
Ideally, this class is shrunk to 64 bytes.
2017-04-29 09:16:32 +02:00
Vincent Glize
8b9f88a170 [CSM] add screenshot api lua (#5674)
* [CSM] add screenshot api lua
2017-04-29 09:16:06 +02:00
ShadowNinja
dc73e2cec8 Clean up getTime helpers
This increases size of the getTime return values to 64 bits.
It also removes the TimeGetter classes since the getTime functions
are now very precise.
2017-04-28 14:43:18 -04:00
you
722a015f54 Fix click-digging torches (#5652)
Torches are dug instantly again.
When the digging time is 0, a delay of 0.15 seconds is added between digging nodes. If the left mouse button is released, the delay is set to 0, thus click-digging.
2017-04-28 20:12:28 +02:00
Auke Kok
522dc32ac3 Allow mesh and nodeboxes to wave like plants or leaves. (#3497)
We introduce a new value for "waving" - 2:

0 - waving disabled
1 - wave like a plant
2 - wave like a leave

Plantlike nodes will only allow waving = 1, but for leaves we will
permit both 1 and 2 since current minetest_game sets it to 1 for
all leaves. This makes it somewhat backwards compatible.

For mesh and nodebox, values 1 and 2 are both valid, and the node
can wave in both fashions as desired.

I've tested this with the crops:corn plants, which are mesh nodes,
and the results are really good. The code change is trivial as
well, so I've opted to document the waving parameter in lua_api.txt
because it was missing from there.

Nodeboxes likely will not wave properly unless waving = 2. However
it's possible that waving=1 may be desired by some mod developers
for geometries I have not tried, so the code will not prohibit
either value for mesh and nodebox drawtypes.

Add lua_api.txt documentation for this feature and document both
the existing functionality and the expansion to mesh and nodebox
drawtypes.
2017-04-28 20:11:43 +02:00
ShadowNinja
f139b0d336 Fix Travis builds 2017-04-27 10:57:46 -04:00
Louis Pearson
64edc29854 Search user path for sounds (#5657) 2017-04-27 21:33:59 +10:00
Loïc Blot
0c74031aab Don't permit to copy Scripting classes (Client,Server,Mainmenu) 2017-04-27 11:52:44 +02:00
red-001
76bcda535e Allow scripts to get the client protocol version in non-debug builds. (#5649) 2017-04-27 11:49:44 +02:00
Bluebird
c6f26983ee Fix incorrect formspec-tooltip doc, add detail in 'floodable' & 'on_flood' docs (#5660)
* Fix incorrect formspec tooltip documentation

* Improve `floodable` and `on_flood` documentation.

The original documentation did not specify that liquids should not themselves be floodable. This is probably something that should be mentioned.
2017-04-27 11:49:07 +02:00
Loic Blot
ab2ce07b5b Fix Android build since 2818d3f2244d2146a5cdb61cd41f6561c514f97c 2017-04-26 21:11:46 +02:00
red-001
65c94f03af Fix #5655 (#5658)
Client: Don't send `TOSERVER_RECEIVED_MEDIA` since it's not used anymore
Server: Handle `TOSERVER_RECEIVED_MEDIA` using `Server::handleCommand_Deprecated`
2017-04-26 21:10:13 +02:00
Bluebird
bb7b58166e Tiny documentation fix. (#5659)
There are plenty of lines longer than 80 characters, and spliting the function declaration across two lines can be momentarily confusing.
2017-04-26 07:24:15 +02:00
ShadowNinja
b41838b8ef Rename Scripting API files for consistency 2017-04-25 13:41:36 -04:00
Louis Pearson
e96727dde7 Footsteps without view bobbing (#5645)
* Remove redundant view_bobbing setting

Also fixes bug where disabling view_bobbing disables footstep sounds.

* Removes redundant view_bobbing setting

Setting view_bobbing amount to 0 is now the only way to
turn view_bobbing on and off. Also fixed a bug where footstep
sounds would not play when view_bobbing was disabled.
2017-04-25 21:11:51 +10:00
Loïc Blot
24467fdfba Fix various points reported by cppcheck (#5656)
* Fix various performance issues reported by cppcheck + code style (CI)

* Make CI happy with code style on master
* guiFileSelectMenu: remove useless includes
* some performance fixes pointed by cppcheck
* remove some useless casts
* TextDest: remove unused setFormSpec function

* Fix various iterator post-increment reported by cppcheck
2017-04-25 10:21:42 +02:00
Loïc Blot
9005b909b6 Gitlab-CI: keep build workspace only 1 hour 2017-04-24 16:06:27 +02:00
Loic Blot
69a3ee22ce Fix lint since recent player to db merge 2017-04-23 16:22:53 +02:00
Loïc Blot
799890d946 Player data to Database (#5475)
* Player data to Database

Add player data into databases (SQLite3 & PG only)

PostgreSQL & SQLite: better POO Design for databases

Add --migrate-players argument to server + deprecation warning

* Remove players directory if empty
2017-04-23 14:35:08 +02:00
Loic Blot
289c01d7f5 LINT fix 2017-04-23 10:24:00 +02:00
Loic Blot
dee3c8d9a3 Revert "CONTRIBUTING: disallow signed git commits"
This reverts commit 7a6502a7a5007e4bed8c1dd10af39d4fa2b296a4.

Signed commits are supported by PPA and weblate now
2017-04-23 10:21:08 +02:00
Loïc Blot
82c33da94f Pass clang-format on various cpp/header files (#5559) 2017-04-23 09:52:40 +02:00
red-001
3fd3573def Network:Remove old opcodes and fix documentation. (#5573) 2017-04-22 13:59:02 +02:00
paramat
c8e1a6b079 Mgflat, Mgv7: Fix noise crash on world exit.
Fix crash caused by destructor 'delete' on noise objects that are not
created due to mapgen options.
Crash was caused by commit 57eaf62c697cec91890d9cb28d10385d293d2d3f
2017-04-22 05:37:33 +01:00
Dániel Juhász
05ff3806f5 Add /fixlight chat command 2017-04-22 01:24:41 +01:00
paramat
406249ebc2 Mgflat, Mgv7: Only create noise objects if needed 2017-04-22 01:24:03 +01:00
paramat
809ac7f70c Sneak glitch: Set default to false
The 'sneak glitch' physics override now controls whether a player can
use the new move code replications of the old sneak side-effects:
sneak ladders and 2 node sneak jump. This completes our intention to
replicate the old sneak side-effects in new code and provide them as
an option that is disabled by default.
2017-04-22 01:23:57 +01:00
Auke Kok
f106e1cb0b Add on_flood() callback.
This callback is called if a liquid definitely floods a non-air
node on the map. The callback arguments are (pos, oldnode, newnode)
and can return a `bool` value indicating whether flooding the
node should be cancelled (`return true` will prevent the node
from flooding).

Documentation is added, the callback function was tested with a
modified minetest_game.

Note that `return true` will likely cause the node's `on_flood()`
callback to be called every second until the node gets removed,
so care must be taken to prevent many callbacks from using this
return value. The current default liquid update interval is 1.0
seconds, which isn't unmanageable.

The larger aim of this patch is to remove the lava cooling ABM,
which is a significant cost to idle servers that have lava on their
map. This callback will be much more efficient.
2017-04-22 01:23:51 +01:00
Dániel Juhász
b8c716b0a2 Fix a memory leak (#5636) 2017-04-22 00:55:07 +02:00
Loic Blot
0a939d4890 Fixing warning pointed by @sfan5 and clang and cleanup guiFileSelectMenu
* Also pass clang-format on guiFileSelectMenu.h and remove it from whitelist
2017-04-22 00:51:56 +02:00
Loic Blot
819fca7a0e Revert a const ref on update texture
if mod is a reference to a class member a variable swap breaks.
We should find a way to keep this const ref if possible.
Added a comment about this in header
2017-04-22 00:36:59 +02:00
Loïc Blot
5cb71bd1f8 lua: remove core.cause_error call (#5637)
it was used in minimal to trigger core crash, not very useful
2017-04-22 00:34:00 +02:00
Loïc Blot
a5223db5e1 Fix various performance issues reported by cppcheck + code style (CI) (#5635)
* Make CI happy with code style on master
* guiFileSelectMenu: remove useless includes
* some performance fixes pointed by cppcheck
* remove some useless casts
* TextDest: remove unused setFormSpec function
2017-04-21 23:40:48 +02:00
orwell96
3843c97c3a Fix #5617 - respect message and reconnect parameters when shutting down immediately (#5621) 2017-04-21 19:31:59 +02:00
Dániel Juhász
340732fa95 Fix after soft node overlays
This removes a segmentation fault and makes node meshes well colorized.
2017-04-21 19:18:09 +02:00
Dániel Juhász
b12ed27315 Soft node overlay (#5186)
This commit adds node overlays, which are tiles that are drawn on top of
other tiles.
2017-04-21 23:34:59 +10:00
Loïc Blot
a0dc37d242 Gitlab-CI enhancements (#5629) 2017-04-21 10:22:20 +02:00
Loïc Blot
382540e76e Fix various performance issues reported by cppcheck (#5628)
* Also remove 1 non declared but defined functions
2017-04-21 10:06:08 +02:00
Ekdohibs
030ed15201 Run generate_from_settingtypes.lua 2017-04-20 06:06:15 +02:00
Dániel Juhász
fc3bfe1c00 Light update for map blocks
This is not really different from the light update of a voxel
manipulator. This update does not assume that the lighting was correct
before, therefore it is useful for correction.

Also expose this function to the Lua API for light correction, and
allow voxel manipulators not to update the light.
2017-04-20 05:39:14 +02:00
Dániel Juhász
17352c0172 Split light update into two parts
The common part can be reused.
2017-04-20 05:31:50 +02:00
Loïc Blot
118cdbc26e Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)
* Also remove 2 non declared but defined functions
* Make some functions around const ref changes const
2017-04-20 00:12:52 +02:00
Loïc Blot
6d77b9ce43 Fix various copy instead of const ref reported by cppcheck (#5615)
* Also remove InventoryList::peekItem unused function
* Fix some post increment to preincrement reported by cppcheck
2017-04-19 23:02:07 +02:00
paramat
5295b30856 Conf.example: Move some lines to minetest.conf.example.extra
Some information in conf.example cannot be generated from
settingtypes.txt, moving it to a new file makes generating
conf.example while preserving that information easier.

Regenerate conf.example from settingtypes.txt.
2017-04-19 02:02:11 +01:00
MarkuBu
f6daef7c63 Pointed thing to face pos: Fix crash if opening door with slab or stair
Avoids crash caused when 'pointed thing -under' and '-above' are not
face-neighbours, for example in the case of pointing to the top half
of a door.
2017-04-19 02:01:42 +01:00
Hybrid Dog
e7500de85c Tools: Fix tool digging speed limit 2017-04-19 02:01:15 +01:00
Loïc Blot
db34330121 Fix various variables passed by copy instead of const ref (#5610)
Pointed by cppcheck
2017-04-19 00:36:30 +02:00
Loïc Blot
6bbf5c5052 Fix broken lint since 04cc9de8f2fbcb11f133c88f02fc11504b3ea6f3 2017-04-18 17:13:50 +02:00