6675 Commits

Author SHA1 Message Date
SmallJoker
ec6803d4b2 mapgen: Fix segfault when selecting invalid mapgen (#5491) 2017-04-01 10:18:13 +02:00
Loic Blot
114b1d89de Fix clang-format Columns Width
Also fix l_client.cpp/h and remove them from whitelist
2017-03-31 22:29:34 +02:00
kilbith
5310fa3b92 Wieldmesh: Natural orientation depending on pitch (#5490) 2017-03-31 22:00:05 +02:00
adrido
dd2efab8ba Windows: Set window icon (#5486) 2017-03-30 20:28:37 +02:00
paramat
82fbf31f61 Paramtype2: Add missing type CPT2_GLASSLIKE_LIQUID_LEVEL
Add the missing paramtype2 for param2 controlling the liquid level
inside the glasslike_framed drawtype.
Add missing documentation of the feature to lua_api.txt.
Update and improve comments for drawtype enumerations in nodedef.h.
2017-03-30 04:52:54 +01:00
Loïc Blot
6310f842bc l_minimap: don't show minimap if configuration doesn't allow it 2017-03-29 15:50:22 +02:00
Loïc Blot
736e505ebc Add CPP11 header to define nullptr & constexpr (#5471)
This header permit to use nullptr & constexpr keywords in portable code segments and benefit from nullptr & constexpr when using C++11 and greater
2017-03-29 13:34:57 +02:00
sfan5
f7278b4f36 Sneak: Fix sneaking on free-floating lower-half slabs 2017-03-29 10:19:49 +02:00
sfan5
70aa704769 Sneak: Fix stair lower step bug and ladder in 1x1 hole bugs 2017-03-29 00:51:13 +01:00
Diego Martínez
3837e7d77e Add functions to strip color information. (#5472) 2017-03-28 21:55:39 +02:00
Loïc Blot
9ae099e7ed Fix a type bug in colorize function
This bug was introduced by dd2f1d7551bfd70357ad4f3fb180704194272147 and reported by @kilbith
2017-03-28 14:50:17 +02:00
red-001
7100121fb6 [CSM] Fix errors in and improve the CSM documentation. (#5467) 2017-03-28 08:26:54 +02:00
Loïc Blot
2003083ca5 clang-format: add a whitelist (#5459)
If file is in the whitelist, softfail, else hard failure

Some files are not in whitelist and marked as normal:
* src/content_mapnode.h
* src/cguittfont/xCGUITTFont.cpp
* src/gameparams.h
* src/profiler.cpp
2017-03-27 15:33:15 +02:00
Loïc Blot
b29d20ea20 PostgreSQL: fix delete block
Typo fix: we are doing select on delete block.

This fix issue #5426
2017-03-27 15:03:13 +02:00
paramat
1bb70a78a9 Map generation limit: Make per-world
The setting limits map generation but affects nothing else.
Add 'mapgen_limit' to global mapgen parameters.
Move 'blockpos_over_mapgen_limit()' to the only place it is called
from: map.cpp.
Allow teleportation to any part of the world even if over the set
mapgen limit.
Simplify the reading of this limit in mgvalleys.
Remove the 'map_generation_limit' setting.
2017-03-27 03:18:09 +01:00
Diego Martínez
0f3cb877d8 Pathfinder: Send errors to warningstream.
Avoids spamming the chat about several errors.
2017-03-27 03:17:37 +01:00
Loic Blot
ba5b7897bb Fix mismatch struct/class for GameUIFlags 2017-03-26 18:54:39 +02:00
Loïc Blot
b24822e755 clang-format: fix counter increment & output (#5456)
clang-format: fix bash syntax on increment
2017-03-26 14:07:07 +02:00
Loïc Blot
6e73c8e167 clang-format: limit diff to 50 files to prevent exceding the maximum travis output (4MB) (#5455) 2017-03-26 11:29:21 +02:00
sfan5
d54c77f6e9 Sneak: Replicate sneak ladder in new code, is optional
Enabled using the existing 'sneak_glitch' physics override.
2017-03-26 05:53:30 +01:00
red-001
792d324efc Change command prefix to "." and add "help" command. 2017-03-26 05:51:14 +01:00
number Zero
f6fdba81af Add mesh generation delay 2017-03-26 05:50:59 +01:00
Loïc Blot
cb62e6390a Add clang format & skip build if no source file modified (#5433)
* [BUILD] Add clang format + build skipping

* Add clang-format tool to check codestyle.
Warning: it check the whole modified file, not the diff part, it's why it's lazy. Please also look if rules are perfect, i take the Linux codestyle from LLVM site

Fix issue #5415

* Skip building project if no file is modified
* Fix a wrong brace to trigger LINT

* Make lint step outside of unix build scope

* Add AccessModifierOffset: -8

* Typo fix & needs compile fix

* Fix header priorities
2017-03-25 19:12:18 +01:00
SmallJoker
7d76bb6a75 Tile.cpp: Fix MSVC build broken by 072bbba 2017-03-24 20:05:15 +01:00
Loïc Blot
4292670b64 Typo fix 2017-03-24 08:59:52 +01:00
red-001
c118df6b00 Add multiline support to colorize. (#5444) 2017-03-24 08:36:29 +01:00
Loïc Blot
e011d331db Some performance optimizations (#5424)
* Some performance optimizations

This is globally removing some memory useless copy

* use a const ref return on std::string Settings::get to prevent data copy on getters which doesn't need to copy it
 * pass some stack created strings to static const as they are not modified anywhere
 * Camera: return nametags per const ref instead of a list pointer, we only need to read it
 * INodeDefManager: getAll should be a result ref writer instead of a return copy
 * INodeDefManager: getAlias should return a const std::string ref
 * Minimap: unroll a Scolor creation in blitMinimapPixersToImageRadar to prvent many variable construct/destruct which are unneeded (we rewrite the content in the loop)
 * CNodeDefManager::updateAliases: prevent a idef getall copy
 * Profiler: constness
 * rollback_interface: create real_name later, and use const ref
 * MapBlockMesh updateFastFaceRow: unroll TileSpec next_tile, which has a cost of 1.8% CPU due to variable allocation/destruction,
 * MapBlockMesh updateFastFaceRow: copy next_tile to tile only if it's a different tilespec
 * MapBlockMesh updateFastFaceRow: use memcpy to copy next_lights to lights to do it in a single cpu operation
2017-03-22 21:41:02 +01:00
bigfoot547
06aac53a03 [CSM] Add function to get player names in range (#5435)
* [CSM] Add function to get currently connected player names
2017-03-22 21:13:03 +01:00
Paramat
11ac74636b Firelike drawtype: Add missing docs for visual_scale in lua_api.txt (#5434) 2017-03-20 22:22:16 +01:00
number Zero
37bfc2352c Content_mapblock.cpp: Refactor 2017-03-20 20:28:22 +00:00
Ben Deutsch
775de73c4e Refactored client event if-else cascade to switch statement 2017-03-20 18:35:33 +00:00
paramat
50dc82ddf9 Map generation limit: Rewrite
The previous implementation applied the setting to blockpos_over_limit(),
objectpos_over_limit() and in createSector(), causing many bugs near the
world edge.

First revert the previous implementation.
Rename blockpos_over_limit() to blockpos_over_max_limit() for clarity.
Add a new function to mapblock.h called blockpos_over_mapgen_limit() that
checks against the map_generation_limit setting, and call this only from
the code that decides where mapgen stops.
Use MAX_MAP_GENERATION_LIMIT in objectpos_over_limit() to reduce the
chance of bugs, there is no need to use map_generation_limit here.
2017-03-20 18:34:18 +00:00
sfan5
12f34b1e3d Fix /shutdown or ^C no longer causing server exit
Broken since b8484ef24e8e1ec90a2967372808ab2bea538c7c
2017-03-19 18:21:18 +01:00
Loïc Blot
d6c34a3407 Refactor Game class (part 2) (#5422)
* showPauseMenu is now part of game
* remove many flags parameters passed to game functions, use the member.
* rename VolatileRunFlags to GameUIFlags (this will permit to share structure with client and CSM
* updatePointedThing: remove pointer ref, we already have the pointer in rundata
* move some attributes outside of VolatileRunFlags after renaming, to game class
* rename statustext to m_statustext
* make some const variables static
* All those changes permit to reduce a little bit function class cost and will permit to interface CSM with some interesting Game flags
* Expose GameUIFlags to client
* Client now have GameUIFlags parameter and setters for other classes
* Fix minimap show/hide in Lua because we now have access to the real flag
2017-03-19 13:18:52 +01:00
red-001
3912e517a8 Block access to the io library 2017-03-19 12:34:33 +01:00
Loïc Blot
32d85e68c6 Update server min protocol version to v24 (#5411)
* Update server min protocol version to v24

It's based on @sfan5 stats. See https://kitsunemimi.pw/tmp/serverlist_stats_2017-03-17.txt

v24 was bumped 25/08/14 and 0.4.11 was released 25/12/14

* Drop protocol v23 and lesser code
2017-03-19 08:44:29 +01:00
ShadowNinja
92b0c89d90 Server list cleanup
This removes the hacky server_dedicated pseudo-setting.
2017-03-18 12:37:57 +01:00
Wuzzy
088c4d9e92 Show itemstring as tooltip if no item description 2017-03-18 12:36:28 +01:00
Loic Blot
185ce334b8 TOGGLE_CHAT keymap should togglechat not HUD
Fixes #5413
2017-03-18 10:00:04 +01:00
Loïc Blot
d5a9b41e23 Reduce memory & function cost of Game class functions (#5406)
GameRunData is passed on many game functions, or one of its attributes whereas it's a member of the class. Remove it from functions arguments and call object directly from concerned functions.
This will reduce a little bit the Game class loop usage & very little bit the memory usage (due to non creation of pointer/references)
2017-03-17 22:15:25 +01:00
zeuner
4fe5579bbe avoid crashing when accessing mapgen early (#5384) 2017-03-17 21:28:43 +01:00
red-001
9a9db57881 Give CSM access to use core.colorize() (#5113) 2017-03-17 19:20:13 +01:00
Loïc Blot
6ec8516c8f [CSM] Fix minimap problems (#5405)
This fixes issue #5404
2017-03-17 07:54:49 +01:00
Loïc Blot
6483d88b89 [CSM] Add core.get_timeofday & core.get_day_count env calls (#5401)
* [CSM] Add core.get_timeofday & core.get_day_count env calls

* [CSM] Add core.get_node_level, core.get_node_max_level, core.find_node_near
2017-03-17 07:48:29 +01:00
Loïc Blot
a097a0d4ef Fix indentation problem since merge resolution
Github merge conflict resolution is not the best with indent
2017-03-16 11:09:06 +01:00
Loïc Blot
b9e61d4da3 [CSM] Add minimap API modifiers (#5399)
* Rename Mapper (too generic) to Minimap
* Add lua functions to get/set position, angle, mode for minimap
* Client: rename m_mapper to m_minimap
* Add minimap to core.ui namespace (core.ui.minimap)
* Add various functions to manage minimap (show, hide, toggle_shape)
* Cleanup trivial declaration in client
2017-03-16 10:34:54 +01:00
Loïc Blot
aadc6b9f06 Add ModStorageAPI to client side modding (#5396)
mod storage is located into user_path / client / mod_storage
2017-03-16 07:53:39 +01:00
paramat
fc7d75c19d Get biome list: Downgrade missing biome message to infostream
It is harmless for a biome listed in an ore or decoration registration
to be missing.
Now that we are registering certain biomes or not based on options
(such as floatland biomes), the biome lists in ore and decoration
registrations trigger these error messages, avoiding these error
messages would need a large amount of duplication of ore and decoration
registrations.
2017-03-16 02:56:03 +00:00
sfan5
01cf90c77a Sneak: Fix various problems with sneaking
Sneaking won't actually hover you in the air, releasing shift guarantees not
falling down (same as in MC).
Sneak-jump no longer goes higher than a normal jump (^ was required for this).
Sneaking no longer avoids fall damage.
You can sneak on partial nodes (slabs, sideways slabs) correctly.
Sneaking doesn't "go out" as far anymore (0.29 instead of 0.4).
Can't jump when sneaking out as far as possible (breaks the sneak ladder).
2017-03-16 02:52:59 +00:00
SmallJoker
2c0e744f25 lua_api: Document minetest.features (#5311) 2017-03-15 22:07:19 +01:00