aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_object.cpp
AgeCommit message (Collapse)Author
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
2015-05-16SAPI: Accept either ARGB8 table or ColorString to specify colorskwolekr
2015-05-15Add push_ARGB8 to script/common/c_converterTeTpaAka
2015-05-15Generalize core.get/set_nametag_color into core.get/set_nametag_attributesTeTpaAka
2015-05-15Add get and set functions for the nametag colorTeTpaAka
2015-05-12is_player() is no player-only functionest31
2015-03-22Revert "Add a Lua call to do damages / heals" ok @ShadowNinjaLoic Blot
This reverts commit 467fc0ddc912ae38c3bf9fcb99e0b66d7478eec0.
2015-03-18Add a Lua call to do damages / healsLoic Blot
2015-03-04We always know playerSAO when calling SendInventory. Using it instead of ↵Loic Blot
searching it via peer_id
2015-03-04Send Inventory packet on event, don't check it at each AsyncRunStep.Loic Blot
* Call UpdateCrafting into SendInventory because this functions is only called before SendInventory * Use Player* instead of peer_id for UpdateCrafting because SendInventory already has the Player* pointer, then don't loop for searching Player* per peer_id * m_env_mutex don't need to be used with this modification because it's already locked before the calls
2015-03-03Send Breath packet on event, don't check it at each AsyncRunStepLoic Blot
2015-03-03Send Player HP when setHP (or a setHP caller) is called instead of looping ↵Loic Blot
and testing the state change.
2015-02-23Disallow object:remove() if the object is a playerKahrl
Rebased by Zeno- (conflict in lua_api.txt)
2015-02-17SAO work: ActiveObject types & SAO cleanup * Replace u8 types with ↵Loic Blot
ActiveObjectType. * Merge content_object.h into activeobject.h * Remove DummyLoadSAO, it's now unused. * Remove ItemSAO, it's also unused
2015-01-07Fix direction property of HUDrubenwardy