Commit Graph

3980 Commits

Author SHA1 Message Date
SmallJoker 31c1fca6fd tile.cpp: Automatically upscale lower resolution texture 2016-04-25 06:39:32 +01:00
gregorycu 46da0e8b3b Make GUIEngine use pause_fps_max not fps_max 2016-04-24 17:40:16 +10:00
Ekdohibs 48939df9a5 Escape more strings: formspecs, item descriptions, infotexts...
Also, change the escape character to the more standard \x1b
Thus, it can be used in the future for translation or colored text,
for example.
2016-04-24 03:54:11 +10:00
Xunto 21079cc8eb Fix bug that was leading to oversized tooltips containing multiline text when it have multiple lines 2016-04-23 21:12:53 +10:00
Ekdohibs c350cfb50b Make logging use a fixed-length buffer to avoid race conditions.
Previously, race conditions occurred inside logging, that caused
segfaults because a thread was trying to use an old pointer that
was freed when the string was reallocated. Using a fixed-length buffer
avoids this, at the cost of cutting too long messages over seveal lines.
2016-04-21 10:15:17 +01:00
paramat 5c32c5e945 Biomes: Make dust fallback 'ignore' to fix y = 63 lighting
The shadow bug at y = 63 was caused by dark air being placed as dust,
when the biome dust was unspecified it was falling back to 'air'
In dustTopNodes only dust == 'ignore' will disable dust placement
2016-04-21 10:15:12 +01:00
paramat fed5dd3b5d Mgv7: Combine mountain terrain generation with base terrain generation
Previous mountain terrain generation was by necessity placing
stone in air, this was removing air from any overgenerated
structures such as tunnels, dungeons and large caves
Moving it into the base terrain generation loop ensures that
only 'ignore' is replaced

generateRidgeTerrain: only return if node_max.Y < water_level - 16
Previously, if water level was set a few nodes above a mapchunk
border the river channel was only partially excavated
2016-04-20 06:51:20 +01:00
TriBlade9 6530ed4dd8 Add option to disable entity selectionboxes. (#3992)
Setting only loaded once, default value is to enable them.
2016-04-14 11:20:11 +02:00
rubenwardy b5f6d41eed Fix inventory hud scaling 2016-04-12 23:10:28 +10:00
paramat 4fdf66bbf4 Mgv7, mgflat, mgfractal: Tunnel generation code optimisation 2016-04-12 06:58:04 +01:00
paramat e661d8b32c Mgv5: Optimise tunnels, add biome material in entrances
Place biome top node on tunnel entrance floor
Instead of doing nothing at node_max.Y + 1 use 1-down
overgeneration for tunnel generation and noisemaps
2016-04-12 04:16:15 +01:00
paramat fe349d401d Mgvalleys: Don't let cavegen place biome nodes everywhere
Fix use of 'air_above' bool so that biome
nodes are only placed in tunnel floors
Minor code improvements
'Continue' when massive cave air is placed
2016-04-12 04:16:08 +01:00
PilzAdam 73d4538d94 Fix hotbar placement on displays with low screen density 2016-04-11 23:04:42 +02:00
kwolekr 2eeb62057a Hud: Cache hud_scaling, fix minor style issues 2016-04-10 23:54:34 -04:00
rubenwardy eae33951ad Hud: Fix offset being ignored by inventory bar 2016-04-10 23:54:23 -04:00
est31 9a04dfd0f5 Update CSRP-GMP to commit deaa11a7c29a73008
Backports 10 commits, with 8 commits
actually affecting source code:

695822e45d...deaa11a7c2
2016-04-10 14:56:54 +02:00
paramat 465bb6f5d1 Mapgen: Optimise cave noises and tunnel excavation
Instead of doing nothing at node_max.Y + 1 use 1-down
overgeneration for tunnel generation and noisemaps
Move some old unused code in mgv7 to end of file
2016-04-08 03:14:36 +01:00
kwolekr c3993f6604 Re-add and disable blit_with_interpolate_overlay 2016-04-07 04:01:43 -04:00
Nathanaël Courant 15e1dcc020 Fix #3955 (player dying on login).
It was caused by player not moving because fall was prevented, but their
velocity still increasing, causing fatal fall damage when world was
finally loaded. This commit fixes it by setting player velocity to zero
when the world around them is not loaded.
2016-04-06 01:11:36 +02:00
Samuel Sieb 24b32ab09d Fix compiler warnings from "Add an option to colorize to respect the destination alpha"
Fix warnings added by commit 01ae43c480

Fixes #3952
2016-04-06 00:36:24 +02:00
Samuel Sieb 01ae43c480 Add an option to colorize to respect the destination alpha
Also, rework the colorizing code to be more efficient.
2016-04-03 04:24:28 -04:00
kinokoio 66af984e0e Dungeongen: Update disabled torch placement code 2016-04-03 04:12:07 -04:00
est31 b8ac7b80e6 Fix nametag hiding
Commit

c3b279750e "Move object nametags to camera"

has added a regression to still display
a shadow if their alpha got set to 0.
2016-04-02 02:02:19 +02:00
gregorycu f9a90383e1 Remove expensive copy of ContentFeatures 2016-03-30 11:38:42 -04:00
Loic Blot e082c7766a ParticleManager::handleParticleEvent: use switch
Use a proper switch with breaks.
2016-03-30 17:20:24 +02:00
est31 0aac1b7403 mg_schematic: fix leak in lua API, and small cleanup
* Fix leak like behaviour if you load multiple schematics in a loop.

* Cleanup check in for, fixing theoretical out of bounds read if
	Schematic::deserializeFromMts reduced the number of elements
	in m_nodenames. A != check may need an overflow of the counter
	before it hits, if origsize is larger than m_nodenames.size().

* Fix function name passed to errorstream: it was wrong. Also use
	__FUNCTION__ instead of manually using the method name at other
	places in the function.

* Don't shadow the name member in the loop.
2016-03-30 16:26:05 +02:00
kwolekr 0115da1d63 Mapgen: Don't spread light of nodes outside the desired area
This fixes #3935, a regression from 0338c2e.
An 'optimization' was performed where an index for the VoxelManip being
operated on was mistakenly used for bounds checking within the incorrect
VoxelArea, namely, the area wherein light should be spread.
2016-03-30 00:19:03 -04:00
paramat 630f453da4 Mgv7: Decrease cliff steepness 2016-03-30 01:53:14 +01:00
kwolekr 0338c2eb91 Mapgen: Spread both night and day light banks in spreadLight 2016-03-29 16:32:30 -04:00
sfan5 8f43aaf6ae Fix small formatting issue in SRP debug output
Writing an u8 to verbosestream writes a char, not it's numeric value.
2016-03-29 19:59:14 +02:00
Auke Kok 80cec4702d Fix connected nodes' selection boxes.
This allows the player to more easily target and punch connected
nodeboxes, especially if they have a fixed nodebox that is very
small, like technic cabling, or xpanes. Tried it on fences and
my xpane conversion, and happy with the result.
2016-03-21 17:42:20 +00:00
paramat 493a298c0c Mgv7/flat/fractal: Stop tunnel-floor biome nodes being placed everywhere
A bool for 'in or under tunnel' was missing
1-node-deep stone ledges were being
replaced with biome surface material
2016-03-21 17:42:13 +00:00
ShadowNinja 93887043d9 Clean up Strfnd
Changes:
  * Fix indentation.
  * Pass strings by const reference.
  * Merge Strfnd and WStrfnd into one class instead of copying them.
  * Remove trailing spaces.
  * Fix variable names.
  * Move to util.
  * Other miscellaneous style fixes.
2016-03-19 21:27:57 -04:00
paramat f1aea6b4ff Mgv7: Limit pseudorandom caves to surface mapchunk or below
To avoid bright caves at mapchunk borders when generating mapchunks upwards
2016-03-19 17:56:35 +00:00
Auke Kok c5c727d627 Allow NodeTimer, ABM and block mgmt interval changes.
ABM's are hardcoded to run every 1.0s, NodeTimers are hard coded to
run at every 1.0s. Block mgmt is running every 2.0sec.

However, these timers can be better tuned for both higher and lower
values by server owners. Some server owners want to, and have the
resources to send more packets per second to clients, and so they
may wish to send smaller updates sooner. Right now all ABM's are
coalesced into 1.0 second intervals, resulting in large send queues
to all clients. By reducing the amount of possible timers, one can
get a far better response rate and lower the perception of lag.

On the other side of the camp, some servers may want to increase
these values, which again isn't easily doable.

The global settings abm_interval and nodetimer_interval are set to
current values by default. I've tested with 0.2/0.5 type values
and noticed a greatly improved response and better scattering of
nodetimers, as well as enjoying not faceplanting into doors with
pressure plates anymore.
2016-03-19 17:56:26 +00:00
Ekdohibs 095f623fa7 Remove chat escape sequences from chat messages, for future colored chat. 2016-03-15 17:33:15 +01:00
est31 af30183124 Add option to not send pre v25 init packet
The legacy init packet (pre v25) sends information about the client's
password that a server could use to log in to other servers if the
username and password are the same. All the other benefits of SRP of
protocol v25 are missed if the legacy init packet is still sent during
connection creation.

This patch adds an option to not send the v25 init packet. Not sending
the v25 packet means breaking compat with pre v25 servers, but as the
option is not enabled by default, no servers are affected unless the
user explicitly flips the switch. More than 90% of the servers on the
serverlist support post v25 protocols.

The patch also fixes a bug with greying out of non compliant servers
being done wrongly, the min and max params were mixed.
2016-03-15 17:20:09 +01:00
est31 2607b97b4f Fix two reconnect bugs
Fix two bugs related to the reconnect feature
introduced by commit

3b50b2766a "Optional reconnect functionality"

1. Set the password to the stored one

Before, we have done the reconnect attempt with a
cleared password, so using the feature would only
work if you had an empty password.
Thanks to @orwell96 for reporting the bug.

2. Reset the reconnect_requested flag after its use

the_game only writes to the reconect_requested flag
if it sets it to true. It never sets it to false.
If the flag is not reset after its use, all "reset"s
to the main menu will look like the server had
requested a reconnect.
2016-03-15 08:55:45 +01:00
est31 e0151d1054 Much better API for auth.{cpp, h}
* No function overloading
* Adhere coding style and with method names following
  lowercase_underscore_style
* Use std::string in external API, handling these is
  much more fun
2016-03-15 05:55:49 +01:00
paramat bb2ee54d3b Mapgen: Fix light in tunnels at mapchunk borders
Don't excavate the overgenerated stone at node_max.Y + 1,
this creates a 'roof' over the tunnel, preventing light in
tunnels at mapchunk borders when generating mapchunks upwards.
2016-03-14 08:45:01 +00:00
HybridDog c0b6986e38 Fix player teleportation bug whilst sneaking
Only set back position when sneaking if player wasn't teleported by adding and using a bool "got_teleported" to player
it fixes #2876
2016-03-14 08:44:28 +00:00
Auke Kok 5a40a7dad8 Connected nodes: fix 2 minor bugs
1. Copy-paste error: properly test for back-connection.

In the case of two different connected nodebox types, we want to
assure that if A connects to B, that B also connects to A. This test
was accidentally not implemented correctly.

2. Clear the connects_to_ids before deserializing.

With each new connected node, the deserialization code added more
and more targets to the map, since the map wasn't cleared in between
deserialization steps. This caused e.g. wall blocks to connect to
things in the fence connects_to map.
2016-03-14 05:05:04 +01:00
Jeija 089f9bbe81 Resend blocks when modified while sending to client 2016-03-12 23:59:44 +01:00
Diego Martinez 2c72f6da7b Add options for screenshot format and quality 2016-03-12 17:12:43 -05:00
Auke Kok 37b4f0d34c Allow nodes to specify which sides to connect to.
NDT_CONNECTED attempts to connect to any side of nodes that it can
connect to, which is troublesome for FACEDIR type nodes that generally
may only have one usable face, and can be rotated.

We introduce a node parameter `connect_sides` that is valid for
any node type. If specified, it lists faces of the node (in "top",
"bottom", "front", "left", "back", "right", form, as array) that
connecting nodeboxes can connect to. "front" corresponds to the south
facing side of a node with facedir = 0.

If the node is rotatable using *simple* FACEDIR, then the attached
face is properly rotated before checking. This allows e.g. a chest
to be attached to only from the rear side.
2016-03-12 12:08:17 -05:00
Auke Kok e737b1c271 Nodebox: Allow nodeboxes to "connect"
We introduce a new nodebox type "connected", and allow these nodes to
have optional nodeboxes that connect it to other connecting nodeboxes.

This is all done at scenedraw time in the client. The client will
inspect the surrounding nodes and if they are to be connected to,
it will draw the appropriate connecting nodeboxes to make those
connections.

In the node_box definition, we have to specify separate nodeboxes for
each valid connection. This allows us to make nodes that connect only
horizontally (the common case) by providing optional nodeboxes for +x,
-x, +z, -z directions. Or this allows us to make wires that can connect
up and down, by providing nodeboxes that connect it up and down (+y,
-y) as well.

The optional nodeboxes can be arrays. They are named "connect_top,
"connect_bottom", "connect_front", "connect_left", "connect_back" and
"connect_right". Here, "front" means the south facing side of the node
that has facedir = 0.

Additionally, a "fixed" nodebox list present will always be drawn,
so one can make a central post, for instance. This "fixed" nodebox
can be omitted, or it can be an array of nodeboxes.

Collision boxes are also updated in exactly the same fashion, which
allows you to walk over the upper extremities of the individual
node boxes, or stand really close to them. You can also walk up
node noxes that are small in height, all as expected, and unlike the
NDT_FENCELIKE nodes.

I've posted a screenshot demonstrating the flexibility at
    http://i.imgur.com/zaJq8jo.png
In the screenshot, all connecting nodes are of this new subtype.

Transparent textures render incorrectly, Which I don't think is
related to this text, as other nodeboxes also have issues with this.

A protocol bump is performed in order to be able to send older clients
a nodeblock that is usable for them. In order to avoid abuse of users
we send older clients a "full-size" node, so that it's impossible for
them to try and walk through a fence or wall that's created in this
fashion. This was tested with a pre-bump client connected against a
server running the new protocol.

These nodes connect to other nodes, and you can select which ones
those are by specifying node names (or group names) in the
connects_to string array:
      connects_to = { "group:fence", "default:wood" }
By default, nodes do not connect to anything, allowing you to create
nodes that always have to be paired in order to connect. lua_api.txt
is updated to reflect the extension to the node_box API.

Example lua code needed to generate these nodes can be found here:
    https://gist.github.com/sofar/b381c8c192c8e53e6062
2016-03-12 12:08:17 -05:00
ShadowNinja 8c951cae5b Fix chat console not opening after formspec opened over it
The MainMenuManager set the console invisible when a
formspec opened over it, but didn't properly close it,
and the chat console never set itself visible again.
2016-03-12 12:01:40 -05:00
paramat 20312fda18 Documentation: Auto-update conf.example and settings_translation_file.cpp 2016-03-12 04:03:43 +00:00
orwell96 0d2df732e5 Fix ask_reconnect_on_crash option being ignored
Since commit

3b50b2766a "Optional reconnect functionality"

there is a config option named ask_reconnect_on_crash.
It asks the client to reconnect to the server if the server crashed.
It has been implemeted and works, but due to a function parameter not
being passed it never showed effect. This patch adds the parameter
and fixes the bug.

Also fixes the `reconnect` option of minetest.request_shutdown being ignored.
2016-03-11 23:43:37 +01:00
Auke Kok dc8bf4e928 Avoid try/catch for settings.
We can just test for the presence of these settings nicely here,
no need to use a try / catch construct.
2016-03-09 01:45:23 +01:00