aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_object.cpp
AgeCommit message (Collapse)Author
2020-04-11Move serveractiveobject & unitsaoLoic Blot
Move serverobject.{cpp,h} to server/serveractiveobject.{cpp,h} Move UnitSAO class to dedicated files
2020-04-11scriptapi: Sort out ServerEnvironment / Environment distinction properlysfan5
The API implementation is shared between CSM and SSM. Functions should retrieve a plain env when they do not need any server-specific functions.
2020-03-08Fix star visilibity and documentation (since 946c03c6)Jordan Snelling
Fix memory leak (unused allocation) Fix star rendering Rename sky color struct Fix stars on android Remove extraneous .data() from android star draw
2020-03-05set_sky improvements, set_sun, set_moon and set_starsJordach
2020-02-23Move core.get_connected_players() implementation to C++sfan5
Keeping the ObjectRefs around in a table isn't ideal and this allows removing the somewhat nonsensical is_player_connected() added in 86ef7147.
2020-02-11Script API: Check that SAOs are still usable before attempting to use themsfan5
2019-09-22Punchwear (improved) (#8959)sfan5
2019-09-21Wieldhand: Specify which ItemStack to use (#8961)SmallJoker
Makes 'get_wield_item' to return the "main" ItemStack
2019-09-19Add support for per-player FOV overrides and multipliersAnand S
2019-08-24Inventory: Send dirty lists where appropriate (#8742)SmallJoker
This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time. Raises protocol version to 38 to ensure correct backwards-compatible code.
2019-08-10Implement adding velocity to player from Luasfan5
The intended usecase is knockback, but there's potential for more.
2019-08-07Unify wield item handling (#8677)SmallJoker
This moves the wield item functions to Player and the tool utils for range calculation Also 'local_inventory' was removed due to redundancy in Client
2019-07-30Move the clamping of hp/breath when their maximums change to ↵Beha
read_object_properties(). (#8689) This prevents set_properties() calls that have nothing to do with hp_max or breath_max overriding the saved hp before another mod has the chance to set a player's intended hp_max (such as in on_joinplayer).
2019-05-21Fix forgotten PlayerSAO cast in a90f2efSmallJoker
2019-05-21Check for out-of-bounds breath when setting breath_max (#8493)ANAND ツ
2019-04-28Force send a mapblock to a player (#8140)sofar
* Force send a mapblock to a player. Send a single mapblock to a specific remote player. This is badly needed for mods and games where players are teleported into terrain which may be not generated, loaded, or modified significantly since the last player visit. In all these cases, the player currently ends up in void, air, or inside blocks which not only looks bad, but has the effect that the player might end up falling and then the server needs to correct for the player position again later, which is a hack. The best solution is to send at least the single mapblock that the player will be teleported to. I've tested this with ITB which does this all the time, and I can see it functioning as expected (it even shows a half loaded entry hallway, as the further blocks aren't loaded yet). The parameter is a blockpos (table of x, y, z), not a regular pos. The function may return false if the call failed. This is most likely due to the target position not being generated or emerged yet, or another internal failure, such as the player not being initialized. * Always send mapblock on teleport or respawn. This avoids the need for mods to send a mapblock on teleport or respawn, since any call to `player:set_pos()` will pass this code.
2019-04-11Add node field to PlayerHPChangeReason table (#8368)Paul Ouellette
2019-04-07Add deprecation warnings for ObjectRef:get/set_attribute (#8443)ANAND
2019-03-12HPChange Reason: Fix push after free, and type being overwritten (#8359)rubenwardy
* HPChange Reason: Fix push after free, and type being overwritten Fixes #8227 and #8344
2019-02-10Consistent HP and damage types (#8167)SmallJoker
Remove deprecated HUDs and chat message handling. Remove unused m_damage variable (compat break). HP: s32 for setter/calculations, u16 for getter.
2019-01-06Fix various bugs (Anticheat, Lua helpers) (#8013)SmallJoker
* Fix various bugs (Anticheat, Lua helpers) Anticheat: Use camera position instead of player position for shoot line calculations Lua helpers: Increase 'i' to not overwrite earlier added table values * Remove lag compensation * * 1.5 for larger selection boxes
2018-11-28Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)CoderForTheBetter
* Adds Lua methods 'set_rotation()' and 'get_rotation'. Also changed some method names to be more clear. Instead of an f32 being sent over network for yaw, now a v3f is sent for rotation on xyz axes. Perserved Lua method set_yaw/setyaw so that old mods still work, other wise to set yaw they would need to switch to set_rotation(0, yaw, 0).
2018-07-08Lua templating reading (part 4): s16, v2s16, v2f (#7512)Loïc Blot
2018-07-01Log deprecated Lua function calls (#7491)SmallJoker
2018-06-30Modernize lua read (part 2 & 3): C++ templating assurance (#7410)Loïc Blot
* Modernize lua read (part 2 & 3): C++ templating assurance Implement the boolean reader Implement the string reader Also remove unused & unimplemented script_error_handler Add a reader with default value
2018-06-04Modernize lua read (part 1): C++ templating insurance (#7394)Loïc Blot
* Modernize lua read (part 1): C++ templating assurance Implement the float reader
2018-05-31Fix isNan on setYaw Lua call (#7380)Loïc Blot
* Fix isNan on setYaw Lua call
2018-04-30Allow damage for attached objects, add attach/detach callbacks (#6786)SmallJoker
* Allow right-clicking on attached LuaEntities
2018-04-06Add player:get_meta(), deprecate player attributes (#7202)rubenwardy
* Add player:get_meta(), deprecate player attributes
2018-04-02Fix many issues reported by clang-tidy (#7189)Loïc Blot
* Fix many issues reported by clang-tidy We have many issues in code related to some performance to float <-> double. Clang-tidy reported it in performance-type-promotion-in-math-fn I fixed many of them. It's not ready for a promote to blocking Also fix some value which should be const-ref
2018-03-31ObjectRef: Add add_velocity() (#3208)you
Allow changing the velocity of objects relatively to their current velocity
2018-03-28Add reasons to on_dieplayer and on_hpchangeAndrew Ward
2018-03-28Add formspec theming using prepended stringsAndrew Ward
2018-03-08Cleanup & bugfixLoic Blot
* ObjectRef::set_local_animation: fix wrong lua return (should push a boolean, currently returns nil) * ObjectRef::set_eye_offset: fix wrong lua return (should push a boolean, currently returns nil) * Fix various Server functions which depends on RemotePlayer objet and return true/false when player object is nil whereas it's a caller implementation error. Change those bool functions to void and add sanitize_check call instead. Current callers are always checking player object validity * Optimize Server::setClouds : use CloudParams object ref instead of attribute deserialization from structure & perform RemotePlayer::setCloudParams directly in server class like many other calls * Optimize Server::SendCloudParams: use CloudParams object ref instead of deserialized attributes
2018-03-08Cleanup: drop Server::hudGetHotbarSelectedImage()Loic Blot
Call directly accessible RemotePlayer::getHotbarSelectedImage() from server api
2018-03-08Cleanup: drop Server::hudGetHotbarImage()Loic Blot
Call directly accessible RemotePlayer::getHotbarImage() from server api & make it const ref
2018-03-08Cleanup: drop Server::hudGetHotbarItemcount()Loic Blot
Call directly accessible RemotePlayer::getHotbarItemcount() from server api
2018-01-20[CSM] Add basic HUD manipulation. (#6067)red-001
* [CSM] Add basic HUD manipulation. Workaround for on_connect not working right now.
2017-09-30Make Player::peer_id server-side only and add getters and setters (#6478)Loïc Blot
* Make Player::peer_id server-side only and add getters and setters Player::peer_id has no sense client side, move it to server, make it private and add setter and getter Also add some PEER_ID_INEXISTENT instead of harcoded 0
2017-09-15ServerEnv: Clean up object lifecycle handling (#6414)sfan5
* ServerEnv: Clean up object lifecycle handling
2017-09-01Fix animation frame_speed and blend loosing precision due to incorrec… (#6357)sapier
* Fix animation frame_speed and blend loosing precision due to incorrect data type Add lua function set_animation_frame_speed to update the frame speed without resetting the animation to start
2017-08-23Respect object property hp_max field for players (#6287)SmallJoker
* Respect object property hp_max field for players This allows modders to configure the maximal HP per player * Statbars: Downscale bar to full 20 HP when exceeding this value Add default max HP for players and breath constants to builtin Document the constants * Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT
2017-08-20Minimap: Add new HUD flag for minimap radar modeparamat
Flag default is true to not change default behaviour. The existing minimap HUD flag remains the master control for minimap.
2017-08-20Modernize source code: last part (#6285)Loïc Blot
* Modernize source code: last par * Use empty when needed * Use emplace_back instead of push_back when needed * For range-based loops * Initializers fixes * constructors, destructors default * c++ C stl includes
2017-08-19Code modernization: subfolders (#6283)Loïc Blot
* Code modernization: subfolders Modernize various code on subfolders client, network, script, threading, unittests, util * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Make connection.cpp readable in a pointed place + typo
2017-08-18Optimize headers (part 2) (#6272)Loïc Blot
* Optimize headers (part 2) * less debug.h in headers * less remoteplayer.h for everybody * Cleanup (part 2) * camera.h: mesh.h * mapgen.h: mapnode.h * serverenvironment.h: mapblock.h * nodedef.h: shader.h
2017-07-24Clouds API: change speed from 'y' to 'z', ColorSpecs in Lua docs (#6164)Ben Deutsch
2017-06-04C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)Loïc Blot
2017-05-23Fix wrong return value in get_sky Lua call since ↵Loic Blot
ad9fcf859ec2347325830e09504ae96968b51ea8 Fix #5803
2017-05-07Player attrs: permits to remove an attribute by setting value to nil (#5716)Loïc Blot
* Player attrs: permits to remove an attribute by setting value to nil When doing player:set_attribute("attr", nil) remove attribute Also remove a useless check on C++ API part (already done by checkplayer) Fix #5709