Commit Graph

100 Commits (e98d421aff046a2d9a9b87516779603dc170b209)

Author SHA1 Message Date
MoNTE48 e98d421aff Merge remote-tracking branch 'upstream/stable-0.4' into sync 2019-04-01 20:18:54 +02:00
SmallJoker f6286e636b C++03 oldify in various source files 2018-06-03 17:32:00 +02:00
Loic Blot 2127408133 Fix C++03 compiling due to C++11 initialization issues in backport 2018-06-03 17:32:00 +02:00
SmallJoker c4fb2c83e9 Localplayer: Fix disable_jump effect and getStandingNodePos()
Leave the old move code untouched.
2018-06-03 17:31:59 +02:00
Paramat a061ea0aa6 Android stepheight: Only increase if 'touching ground' (#6313) 2018-06-03 17:31:59 +02:00
SmallJoker 9bfbc115f1 Sneak: Stripped down version
Fix taking damage caused by sneaking over a nodebox gap.
Fix strange behaviour on stair nodeboxes.
Enable jumping from node edges while sneaking.
Enable movement around corners while sneaking on a 1-node-high groove in a wall.
2018-06-03 17:31:59 +02:00
Maksim Gamarnik 35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
paramat 701d48a1be Revert custom player collision box and step height commits
These caused inability to pass through 2 node high spaces or step up onto slabs
or steps when a new client connected to an older server.
2017-05-09 03:52:28 +01:00
paramat 79f8183022 Custom step height: Fix implementation
Recent commit 45ab62d6a3d90ab3b97aec88251a766cb5dd1899 had a coding error that
made climbing out of water difficult due to an incorrect value of the step height
when not 'touching ground'.
It also incorrectly multiplied the custom stepheight by BS, resulting in being
able to step-up 2 nodes if set to the default of 0.6, or even 0.3.
Also the implementation was wrong because it customised the step height when
not 'touching ground', this step height is for a slight rise when catching the
edge of a node during a jump, and should always remain at 0.2 * BS.
2017-05-08 05:59:19 +01:00
Sapier 1851ad2946 Use stepheight from CAO instead of hardcoded value 2017-05-06 21:18:17 +02:00
TeTpaAka c1a84eb834 Make players respect makes_footstep_sound in the object properties 2017-05-06 20:16:16 +02:00
SmallJoker 1b21a680f0 Sneak: Improve and fix various things
Remove useless `got_teleported`.
Fix jitter when walking against the sneak limits.
Fix damage evading on sneak ladders.
2017-05-03 03:16:20 +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
paramat afe086801d Sneak: Add option for old move code
Temporary option for the old move code for specific old sneak behaviour.
Enabled by setting the added 'new move' physics override to false.
By default 'new move' is true.
2017-04-17 10:13:05 +01:00
paramat bc0ac9a2f4 Sneak glitch: Detect ledge for 2-node climb-up
Re-creates the old sneak-jump behaviour in new code.
Enabled by the 'sneak glitch' physics override.
When a ledge is detected the jump speed modifier is set to the larger
of 'physics override jump' and 1.3 to allow a 2-node climb-up.

An unexpected side-effect is the simple sneak ladder working smoothly.
2017-04-11 05:41:13 +01: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
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
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
paramat d34779544d Footsteps: Fix offset footstep and shallow water sound bugs
Fix footstep sounds coming from nodes to either side when walking on a
1 node wide row of nodebox slabs such as default:snow.
Fix sand footsteps when swimming in 1 node deep water.

Use a new function 'getFootstepNodePos()' instead of 'getStandingNodePos()'
to avoid using a horizontally-offset 'sneak node' for sounds.

Sound is selected from the node BS * 0.05 below the player's feet, so
that 1/16th slabs will play the slab sound but 1/32nd slabs will not.
If the player is not 'touching ground' the node detection position is
changed to BS * 0.5 below to preserve footstep sounds when landing after
a jump or fall.
2017-02-12 01:52:12 +00:00
Maksim Gamarnik e05f7db82f Updated to Minetest ver. 0.4.15 2017-01-30 00:44:07 +02:00
Loic Blot 4fca654fcf Cleanup some header inclusions to improve compilation times 2017-01-11 15:53:56 +01:00
Ner'zhul 14a094c1a2 Environment & IGameDef code refactoring (#4985)
* Environment code refactoring
* Cleanup includes & class declarations in client & server environment to improve build speed
* ServerEnvironment::m_gamedef is now a pointer to Server instead of IGameDef, permitting to cleanup many casts.
* Cleanup IGameDef
  * Move ITextureSource* IGameDef::getTextureSource() to Client only.
  * Also move ITextureSource *IGameDef::tsrc() helper
  * drop getShaderSource, getSceneManager, getSoundManager & getCamera abstract call
  * drop unused emerge() call
  * cleanup server unused functions (mentionned before)
* Drop one unused parameter from ContentFeatures::updateTextures
* move checkLocalPrivilege to Client
* Remove some unnecessary casts
* create_formspec_menu: remove IWritableTextureSource pointer, as client already knows it
* Fix some comments
* Change required IGameDef to Server/Client pointers
* Previous change that game.cpp sometimes calls functions with Client + InventoryManager + IGameDef in same functions but it's the same objects
* Remove duplicate Client pointer in GUIFormSpecMenu::GUIFormSpecMenu
* drop ClientMap::sectorWasDrawn which is unused
2017-01-09 20:39:22 +01:00
lhofhansl 52bf98ff4c Optimize/adjust blocks/ActiveObjects sent at the server based on client settings. (#4811)
Optimize/adjust blocks and active blocks sent at the server based on client settings.
2016-11-30 18:13:14 +10:00
sfan5 d525673848 iOS changed files (#41) 2016-11-06 00:14:16 +02:00
Ner'zhul 4d9f4685ff PlayerSAO/LocalPlayer refactor: (#4612)
* Create UnitSAO, a common part between PlayerSAO & LuaEntitySAO
* Move breath to PlayerSAO & LocalPlayer
* Migrate m_yaw from (Remote)Player & LuaEntitySAO to UnitSAO
* Migrate m_yaw from Player to LocalPlayer for client
* Move some functions outside of player class to PlayerSAO/RemotePlayer or LocalPlayer depending on which class needs it
* Move pitch to LocalPlayer & PlayerSAO
* Move m_position from Player to LocalPlayer
* Move camera_barely_in_ceiling to LocalPlayer as it's used only there
* use PlayerSAO::m_base_position for Server side positions
* remove a unused variable
* ServerActiveObject::setPos now uses const ref
* use ServerEnv::loadPlayer unconditionnaly as it creates RemotePlayer only if it's not already loaded
* Move hp from Player to LocalPlayer
* Move m_hp from LuaEntitySAO to UnitSAO
* Use m_hp from PlayerSAO/UnitSAO instead of RemotePlayer
2016-10-30 14:53:26 +01:00
Loic Blot feaeb523d2 RemotePlayer/LocalPlayer Player base class proper separation (code cleanup) (patch 3 of X)
* remove IGameDef from Player class, only LocalPlayer has it now
* move many attributes/functions only used by LocalPlayer from Player to LocalPlayer
* move many attributes/functions only used by RemotePlayer from Player to RemotePlayer
* make some functions const
* hudGetHotbarSelectedImage now returns const ref
* RemotePlayer getHotbarSelectedImage now returns const ref
* various code style fixes
2016-10-08 22:27:44 +02:00
est31 b7d656581d Initial Gamepad support
Adds initial ingame gamepad support to minetest.

Full Formspec support is not implemented yet and
can be added by a later change.
2016-06-03 19:42:57 +02:00
Maksim Gamarnik 0e40320816 Merge 2016-05-07 23:57:42 +03:00
Maksim Gamarnik f7af85b811 Android: Increase player_stepheight for thicker snow nodebox 2016-05-06 00:32:35 +01:00
Maksim Gamarnik 596801371d ver. 1.2.1.1 2016-03-19 00:16:30 +02:00
Maksim Gamarnik 8f6ddcc57c Merge branch 'upstream/master' 2016-03-14 11:44:17 +02:00
HybridDog 95a304db08 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 f11d473497 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
Maksim Gamarnik babc9be7bd Merge remote-tracking branch 'upstream/master' 2016-02-15 05:10:11 +02:00
Loic Blot 5ea636d82b Player::accelerateHorizontal/Vertical should be member of LocalPlayer 2016-02-14 17:52:10 +01:00
Maksim Gamarnik 2520ca3ed1 Merge branch 'master' of https://github.com/minetest/minetest 2016-01-31 20:57:03 +02:00
est31 d6f58c3f84 Don't pass non-const references to collision methods
Non const references cause a lot of confusion with behaviour of code,
and are disallowed by minetest style guide.
2016-01-29 15:53:54 +01:00
Maksim Gamarnik bcf249297c Merge last Minetest commits 2015-11-10 20:29:00 +02:00
Maksim Gamarnik 919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
kwolekr 74ea2eae9b Fix misc. MinGW and Valgrind warnings 2015-11-08 16:34:56 -05:00
est31 1765eccc0a Only go fast in autorun if fast move is enabled 2015-11-03 15:40:47 +01:00
BlockMen c26f21eb25 Fix jittering sounds on entities (fixes #2974) 2015-10-26 19:40:26 +01:00
BlockMen 7ba5f27c38 Fix sneaking (fixes #665 and #3045) 2015-08-15 20:36:45 +02:00
Maksim Gamarnik 9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
gregorycu f667a66a15 Fix detection of sneaking node
This fixes bug 1551
2015-08-06 03:14:56 -04:00
Miner59 201cac12ae Fix "bouncy" blocks
Before players "bounced" too high. Now, while still allowing to bounce, higher speed bounces are throttled.
2015-08-02 19:40:23 +02:00
SmallJoker 0b925f174d Only retrieve always_fly_fast setting once 2015-05-31 23:21:55 +10:00
TeTpaAka 76c89a3f84 Add some missing getter functions to the lua API
ObjectRef:
get_properties
get_armor_groups
get_animation
get_attach
get_bone_position

Players:
get_physics_override
hud_get_hotbar_itemcount
hud_get_hotbar_image
hud_get_hotbar_selected_image
get_sky
get_day_night_ratio
get_local_animation
get_eye_offset

Global:
minetest.get_gen_notify
minetest.get_noiseparams
2015-05-31 23:21:45 +10:00
SmallJoker 704d68d163 Only retrieve always_fly_fast setting once 2015-05-30 22:29:36 +02:00