aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_object.cpp
AgeCommit message (Collapse)Author
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
2017-05-02Set sky API: Add bool for clouds in front of custom skyboxparamat
Default true. Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API. Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of 'm_visible' (whether normal sky is visible).
2017-04-30Add clouds APIBen Deutsch
2017-04-29Fix visual slide issue with set_detach, fixes #5620shivajiva101
2017-04-25Rename Scripting API files for consistencyShadowNinja
2017-04-17Sneak: Add option for old move codeparamat
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-08Hardware coloring for itemstacksDániel Juhász
Adds the possibility to colorize item stacks based on their metadata. In the item/node definition you can specify palette (an image file) and color (fallback color if the item has no palette or metadata). Then you can add palette_index to the metadata. Dropped itemstacks with different colors do not merge.
2017-04-08Replace luaL_reg with luaL_Reg as recent LuaJIT dropped the Lua 5.0 compat ↵Loïc Blot
(#5541) We are bundling Lua5.1 which has same macro
2017-03-13Add `get_wielded_item`red-001
2017-03-13[CSM] Client side moddingLoic Blot
* rename GameScripting to ServerScripting * Make getBuiltinLuaPath static serverside * Add on_shutdown callback * Add on_receiving_chat_message & on_sending_chat_message callbacks * ScriptApiBase: use IGameDef instead of Server This permits to share common attribute between client & server * Enable mod security in client side modding without conditions
2017-01-27Implement player attribute backend (#4155)Loïc Blot
* This backend permit mods to store extra players attributes to a common interface. * Add the obj:set_attribute(attr, value) Lua call * Add the obj:get_attribute(attr) Lua call Examples: * player:set_attribute("home:home", "10,25,-78") * player:get_attribute("default:mana") Attributes are saved as a json in the player file in extended_attributes key They are saved only if a modification on the attributes occurs and loaded when emergePlayer is called (they are attached to PlayerSAO).
2017-01-21Revert "Detach the player from entities on death." (#5087)Loïc Blot
2017-01-21Add Entity get_texture_mod() to Lua APIsapier
Send texture modifier to clients connecting later too
2017-01-21Detach the player from entities on death. (#5077)red-001
2017-01-17Fix typo in alias for deprecated settexturemodsapier
2017-01-16Rename ObjectRef methods to be consistent and predictablerubenwardy
2017-01-11Make nametag removable with set_nametag_attributes (#5021)Rui
2017-01-11Performance fix + SAO factorizationRogier
Original credits goes to @Rogier-5 * Merge common attributes between LuaEntitySAO & PlayerSAO to UnitSAO * Make some functions const * Improve some lists performance by returning const ref Signed-off-by: Loic Blot <loic.blot@unix-experience.fr>
2017-01-01Breath cheat fix: server sideLoic Blot
Breath is now handled server side. Changing this behaviour required some modifications to core: * Ignore TOSERVER_BREATH package, marking it as obsolete * Clients doesn't send the breath to server anymore * Use PlayerSAO pointer instead of peer_id in Server::SendPlayerBreath to prevent a useless lookup (little perf gain) * drop a useless static_cast in emergePlayer
2016-11-13Fix crash when attached object no longer existsRogier
Active objects that are attached to other objects are not safe from deletion. As a result, the parent object may have a reference to an id of a child's that no longer exists. If at some point an attempt is made to manipulate the child, enviromment->getActiveObject(child-id) returns NULL. Using the NULL pointer causes the crash...
2016-10-30Fix overloading problems mentioned by clangLoic Blot
2016-10-30PlayerSAO/LocalPlayer refactor: (#4612)Ner'zhul
* 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-25Adding LuaError on attempt to assign vectors with values out of rangeFoghrye4
2016-10-08Move RemotePlayer code to its own cpp/headerLoic Blot
2016-10-08RemotePlayer/LocalPlayer Player base class proper separation (code cleanup) ↵Loic Blot
(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-08More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)Loic Blot
* ClientEnvironment now uses UNORDERED MAP for active objects * Use RemotePlayer and LocalPlayer everywhere it's possible * Minor code style fixes * Drop Client::getBreath() unused function
2016-10-08Player/LocalPlayer/RemotePlayer inheritance cleanup (part 2 on X)Loic Blot
* Server/Client Environments now have an helper to cast Player object in the right type to use it * Server: use RemotePlayer everywhere and remove previous added casts * Client: use LocalPlayer where needed * Environment: remove unused functions (getPlayers(), getRandomConnectedPlayer(), getNearestConnectedPlayer())
2016-10-08Prevent attached models from disappearing during parent reload (#4128)Foghrye4
2016-10-08Player/LocalPlayer/RemotePlayer inheritance cleanup (part 1 on X)Loic Blot
* LocalPlayer take ownership of maxHudId as it's the only caller * RemotePlayer take ownership of day night ratio as it's the only user * Pass getPlayerControl as const reference to prevent object copy on each call (perf improvement in ObjectRef::l_get_player_control call) * getPlayerSAO is now only RemotePlayer call * get/setHotbarItemCount is now RemotePlayer owned * Server: Use RemotePlayer instead of Player object on concerned call to properly fix the object type * PlayerSAO now uses RemotePlayer instead of Player because it's only server side * ObjectRef::getplayer also returns RemotePlayer as it's linked with PlayerSAO
2016-06-24Player: New get_look, set_look APIraymoo
Deprecate get_look / set_look pitch / yaw
2015-12-15Add option to give every object a nametagBlockMen
or change the nametag text of players
2015-10-25SAPI: Mark all Lua API functions requiring envlockkwolekr
2015-10-04Define and use limit constants for Irrlicht fixed-width typeskwolekr
2015-08-13minimap: Add ability to disable from serverkwolekr
2015-07-20Added get_player_velocity() method. Fixes #1176Elia Argentieri
2015-07-18Fix invisible player when the attached entity is removedTeTpaAka
2015-07-10Fix damage flash when damage disabledkwolekr
2015-06-22Fix some issues with animations, and allow non-looped animations to be definedMirceaKitsune
2015-05-28Add some missing getter functions to the lua APITeTpaAka
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