aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_object.cpp
AgeCommit message (Collapse)Author
2022-05-29Add API function to invoke player respawnsfan5
closes #12272
2022-04-10Remove unneeded ObjectRef setter return values (#12179)Lars Müller
2022-03-26Add API to control shadow intensity from the game/mod (#11944)x2048
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
2022-03-05Readd basic_debug as a HUD flag (#12020)Lars Müller
2022-03-05Allow get_sky to return a table (#11963)Zughy
2022-01-27Define control(bits) as "unset" for entities (#11995)Lars Müller
2022-01-22Allow resetting celestial vault elements by leaving its arguments empty (#11922)Zughy
2022-01-09Restore pass-through of direction keys (#11924)sfan5
This moves relevant code into the PlayerControl class and gets rid of separate keyPressed variable.
2021-10-31Fix number of tool uses being off by 1..32767 (#11110)Wuzzy
2021-08-28Remove redundant on_dieplayer callssavilli
2021-08-27Joystick sensitivity for player movement (#11262)NeroBurner
This commit deprecates the forward, backward, left, and right binary inputs currently used for player movement in the PlayerControl struct. In their place, it adds the movement_speed and movement_direction values, which represents the player movement is a polar coordinate system. movement_speed is a scalar from 0.0 to 1.0. movement_direction is an angle from 0 to +-Pi: FWD 0 _ LFT / \ RGT -Pi/2 | | +Pi/2 \_/ +-Pi BCK Boolean movement bits will still be set for server telegrams and Lua script invocations to provide full backward compatibility. When generating these values from an analog input, a direction is considered active when it is 22.5 degrees away from either orthogonal axis. Co-authored-by: Markus Koch <markus@notsyncing.net> Co-authored-by: sfan5 <sfan5@live.de>
2021-08-21HUD: Reject and warn on invalid stat types (#11548)SmallJoker
This comes into play on older servers which do not know the "stat" type. Warnings are only logged once to avoid spam within globalstep callbacks
2021-08-19Validate staticdata and object property length limits (#11511)sfan5
Some games provide users with enough freedom to create items with metadata longer than 64KB, preventing this from causing issues is on them but we'll still do the minimum not to abort the server if this happens.
2021-05-30script: Replace calls to depreated luaL_openlibsfan5
2021-02-17Add nametag background setting and object property (#10937)rubenwardy
2021-01-31Preserve immortal group for players when damage is disabledsfan5
2021-01-21ObjectRef: fix some v3f checks (#10602)Zughy
2021-01-02Add on_deactivate callback for luaentities (#10723)hecks
2020-12-23Fix unsafe cast in l_objectrubenwardy
2020-11-10ObjectRef: Re-add legacy code for set_physics_override (#10585)SmallJoker
These arguments are used at least by MTG beds and homedecor_common. A deprecation warning is shown to safely remove it in a future release.
2020-11-04Fix ObjectRef errors due to lua_isnil() (#10564)Zughy
Treat 'none' values as 'nil'
2020-10-31Fix segfault in deprecation logging due to tail call, log by default (#10174)rubenwardy
2020-10-22Clean up l_object.cpp (#10512)Zughy
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2020-10-13Add ObjectRef:get_children() (#10480)Zughy
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2020-10-04Minimap as HUD element with API controlPierre-Yves Rollo
Features: * Define Minimap available modes (surface/radar, scale) from Lua, using player:set_minimap_modes() * New HUD elements for displaying minimap with custom size and placing * New minimap mode for displaying a texture instead of the map
2020-10-04Add First Person Attachments (#10360)Jordan Snelling
Fixes some other third person camera specific attachments. Implements a single new flag for entities to be forced visible in first person mode. Old mods do not need to be updated to use the new flag and are fully backwards compatible.
2020-10-04Deprecate get_player_velocity and add_player_velocity (#10173)rubenwardy
2020-08-27Lua API: Register missing get_texture_mod function (#10338)karamel59
2020-08-15Allow binding dig, place actions to keys; remove LMB/RMB hardcodingANAND
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
2020-06-13Exposing the zoom key to Lua API (#9903)Lars Müller
Co-authored-by: Raul Ferriz <raul.ferriz@gmail.com>
2020-05-07Server class code cleanups (#9769)Loïc Blot
* Server::overrideDayNightRatio doesn't require to return bool There is no sense to sending null player, the caller should send a valid object * Server::init: make private & cleanup This function is always called before start() and loads some variables which can be loaded in constructor directly. Make it private and call it directly in start * Split Server inventory responsibility to a dedicated object This splits permit to found various historical issues: * duplicate lookups on player connection * sending inventory to non related player when a player connects * non friendly lookups on detached inventories ownership This reduce the detached inventory complexity and also increased the lookup performance in a quite interesting way for servers with thousands of inventories.
2020-05-05Sky API: Rename *_tint to fog_*_tint for consistencySmallJoker
2020-05-02set_fov: Add support for time-based transitions (#9705)ANAND
2020-04-27Forbid object:attach(obj, ...) (#9762)Loïc Blot
Fixes #9761
2020-04-18script: Move SAO usability check so that it covers all functions (#9698)sfan5
see also 91eef646a59575bd9ae792e257bb6ad12fafc0b1
2020-04-14scriptapi: Some small optimizations to value pushing (#9669)sfan5
2020-04-11Drop content_sao.{cpp,h}Loic Blot
Move LuaEntitySAO to a new dedicated file Drop TestSAO (useless object) Drop the old static startup initialized SAO factory, which was pretty useless. This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
2020-04-11Move PlayerSAO to dedicated filesLoic Blot
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