5238 Commits

Author SHA1 Message Date
kwolekr
41621bf8f5 Fix Lua scripting synchronization
For several years now, the lua script lock has been completely broken.
This commit fixes the main issue (creation of a temporary rather than
scoped object), and fixes a subsequent deadlock issue caused by
nested script API calls by adding support for recursive mutexes.
2015-11-01 11:32:05 -05:00
kwolekr
3c36a6c0fb Fix Noise compiled under clang >= 3.7.x with -O2 or higher
When compiled with optimizations, the most recent versions of clang seem
to 'optimize' out a crucial "and %reg, 0x7FFFFFFF" instruction in noise2d(),
probably because it somehow assumed the variable n would never become greater
than that amount.
Indeed, signed integer underflow is undefined behavior in C and C++, so while
this optimization is "correct" in that sense, it breaks lots of existing code.
Solved by changing n to an unsigned type, making behavior well-defined.
2015-11-01 11:16:18 -05:00
ShadowNinja
5b1f0e8a26 Fix server crashing on Lua errors
Previously, the server called FATAL_ERROR when a Lua error occured.
This caused a (mostly useless) core dump.
The server now simply throws an exception, which is caught and printed before
exiting with a non-zero return value.
This also fixes a number of instances where errors were logged multiple times.
2015-10-31 13:28:58 -04:00
ShadowNinja
e94ae71889 Fix clang warning 2015-10-31 13:28:58 -04:00
kwolekr
dc2cbf841b Fix C++11 compatibility 2015-10-31 02:38:23 -04:00
Rui914
f4e29e66bb minetest. to core. 2015-10-31 02:28:06 +01:00
Duane Robertson
82562e227c WoW-style Autorun
This allows the player to toggle continuous forward with a key (F by default),
so we don't have to hold down the forward key endlessly.
2015-10-29 21:48:57 +01:00
paramat
25db5b2fbc findSpawnPos: Add setting for max height above water level
Increase default from 6 to 16 to help with mgv7 and mgfractal
Large-scale or alternative mapgens can result in a lowland spawn point not
being found, causing a spawn at (0, 0, 0) possibly buried underground
The max height is now settable to allow correct player spawn
in any mapgen or when using custom noise parameters
2015-10-29 20:03:15 +00:00
paramat
dc48623b7c Mgfractal: Add filler depth noise 2015-10-29 20:02:57 +00:00
kwolekr
6faedaa0ea Add STATIC_ASSERT() macro and use it 2015-10-27 22:27:32 -04:00
kwolekr
e0e2bb3117 Add DISABLE_CLASS_COPY macro (and use it)
Use this macro to disallow copying of an object using the assignment
operator or copy constructor.  This catches otherwise silent-but-deadly
mistakes such as "ServerMap map = env->getMap();" at compile time.

If so desired, it is still possible to copy a class, but it now requires
an explicit call to memcpy or std::copy.
2015-10-27 22:05:08 -04:00
est31
364fd96b9a Environment: Time of day fixes and add serverside getter
-> Put access to time variables under the time lock.
-> Merge both time locks, there is no point to have two locks.
-> Fix the lock being released too early in Environment::setTimeOfDay
-> Add serverside getter so that you don't have to get
	the environment if you only have the server
2015-10-27 23:19:17 +01:00
PilzAdam
bdda29084e Fix missing #include 2015-10-27 15:55:34 +01:00
kwolekr
b1e49cb537 Move basic, non-numeric macros from util/numeric.h to basicmacros.h 2015-10-27 01:53:45 -04:00
BlockMen
c26f21eb25 Fix jittering sounds on entities (fixes #2974) 2015-10-26 19:40:26 +01:00
BlockMen
0e6d654d77 Fix typo 2015-10-26 15:14:22 +01:00
kwolekr
be8bbbe82f SAPI: Fix seed parameter truncation for LuaPseudoRandom constructor
Also fix a potential seed truncation issue on platforms where the
range of ptrdiff_t (the underlying type of lua_Integer) is too small.
2015-10-26 04:04:52 -04:00
kwolekr
be8cc00f50 SAPI: Move core.get_us_time() to Util module 2015-10-26 03:46:36 -04:00
est31
16e67a92b1 Remove some abort() calls
abort() doesn't benefit from the high level abstractions from FATAL_ERROR.
2015-10-26 04:45:00 +01:00
kwolekr
8772291962 SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread 2015-10-25 23:15:57 -04:00
kwolekr
47189162aa SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
est31
92a2249160 Correct comment in l_util.cpp
Remove outdated loglevel list from a l_util.cpp comment,
and rather point to the updated code.
2015-10-26 00:32:48 +01:00
PilzAdam
e65a03fa1b Fix parameter passing to gettext call 2015-10-25 19:14:07 +01:00
BlockMen
b966a46591 Check if hitter has inventory when punching item
Fixes #3280
2015-10-25 18:15:31 +01:00
Rui
0524a56c32 Credits: Remove my name 2015-10-25 16:10:49 +01:00
BlockMen
0e8e40eaa9 Add option to disable backface culling for models
- Disabled by default (except players)
- Fixes #2984
2015-10-25 12:06:08 +01:00
PilzAdam
dd89f8c558 Escape " in generated settings_translation_file.cpp 2015-10-25 10:56:58 +01:00
est31
45f7d3f0c3 Fix out of bounds vector write in Logger::addOutput(ILogOutput *out)
Previously, the invocation of Logger::addOutput(ILogOutput *out) led to
an out of bounds write of the m_outputs vector, resulting in the
m_silenced_levels array being modified.

Fortunately, the only caller of that method was android system logging,
and only since a few commits ago.
2015-10-25 00:13:01 +02:00
PilzAdam
c8597365f2 Fix setting comments 2015-10-24 23:11:21 +02:00
PilzAdam
0100cb232b Don't allow games or mods to add secure. settings 2015-10-24 22:32:03 +02:00
paramat
8032900773 Mgfractal: Independent iterations and scale parameters
Complete set of parameters for each of mandelbrot and julia sets
The julia set structure often needs different iterations and scale
2015-10-24 21:18:40 +01:00
est31
5c89027811 Android: statically load iconv library
Fixes #3291

Thanks to @arpruss for reporting the bug, and suggesting the fix.

Also, remove trailing whitespaces.
2015-10-24 20:47:02 +02:00
est31
1a5dda1bb3 Run updatepo.sh 2015-10-24 20:29:11 +02:00
est31
c9b9732e98 Better gettext support for protocol version mismatch messages
Previously, xgettext failed to resolve the dynamic call.
Thanks to @JakubVanek for pointing this out.
2015-10-24 20:16:47 +02:00
est31
850286ef3c Small logging refactor and additional options
-> Get rid of Logger::logToSystem and use normal downstream output system for android instead

-> Give the downstream output system more information: enrich the log function of ILogOutput
	with information and add ICombinedLogOutput for easier use.

-> Make Logger::getLevelLabel() static and public so that it can be used by downstream log output.

-> Add g_ and m_ prefixes where required
2015-10-24 19:59:39 +02:00
PilzAdam
2fb30ef4d3 Improve Lua settings menu
* Add key settings to setting table and ignore them later
  This way they are added to the auto-generated minetest.conf.example
* Add flags type
* Add input validation for int, float and flags
* Break in-game graphic settings into multiple sections
* Parse settingtpes.txt in mods and games
* Improve description for a lot of settings
* Fix typos and wording in settingtypes.txt
* Convert language setting to an enum
2015-10-24 19:39:15 +02:00
kwolekr
7970d2470d Fix compilation under MSVC and remove unnecessary conditional function prototype
Thanks to SmallJoker for pointing this out.
2015-10-24 13:34:49 -04:00
BlockMen
f55c01f7d8 Fix on_rightclick() being called directly after placing node
fixes https://github.com/minetest/minetest_game/issues/537
2015-10-24 12:18:57 +02:00
cheapie
8da858f42c Improve rollback database indexing
Index more columns in the action table of the rollback DB to improve the performance of /rollback_check
2015-10-24 08:45:38 +02:00
est31
804ce0e79a Flush rollback log more often
Flushes the buffer of rollback actions that wait to get saved in two more situations:

1. Flushes in the destructor of the rollback. This makes the server not
forget the last < 500 rollback entries when it shuts down.

2. Flushes the rollback when /rollback_check is invoked. This is neccessary
as otherwise it leads to confusion if users want to test the rollback functionality
by placing a node and then executing the check on it, or if the actions were
very recent out of other reasons.
2015-10-24 08:45:13 +02:00
kwolekr
33975f6481 Fix some threading things and add additional thread unittests
- Fix thread name reset on start()
- Fully reset thread state on kill()
- Add unittests to check for correct object states under various circumstances
2015-10-24 02:31:23 -04:00
paramat
ae975d7c91 Decoration API: Add flag for placement on liquid surface
Add findLiquidSurface() function to mapgen.cpp
Update lua_api.txt
2015-10-23 21:30:20 +01:00
Robert Zenz
b52fd16e28 Add more ways to pass data to check_player_privs
The callback can now be invoked with either the player object or name as
the first parameter, and with either a table or a list of strings, like
this:

    minetest.check_player_privs(player_name, { shout = true, fly = true })
    minetest.check_player_privs(player_name, "shout", "fly")
    minetest.check_player_privs(player, { shout = true, fly = true })
    minetest.check_player_privs(player, "shout", "fly")
2015-10-22 19:55:48 +02:00
Leonardo
9bccfad62d Translated using Weblate (Portuguese (Brazil))
Currently translated at 72.6% (202 of 278 strings)
2015-10-22 17:45:48 +02:00
Rui
aa1b914e13 Translated using Weblate (Japanese)
Currently translated at 100.0% (278 of 278 strings)
2015-10-22 17:45:48 +02:00
est31
5490dc2d0e Translated using Weblate (German)
Currently translated at 100.0% (278 of 278 strings)
2015-10-22 17:45:48 +02:00
Jun Zhang
5f7583ed44 init_log_streams: check if log_filename is empty.
Fixes #3262.
2015-10-19 12:14:05 +02:00
paramat
d21809ec2e ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility
Update lua_api.txt
2015-10-18 16:42:59 +01:00
Kahrl
2fd897da13 Settings tab: double click opens/closes trees 2015-10-18 11:03:59 +02:00
Kahrl
470641b986 Settings tab: don't autoscroll when toggling "Show technical names" 2015-10-18 10:42:44 +02:00