mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Add ObjRef:is_player() and modify ObjRef:get_player_name() to always return a string to aid better inter-object compatibility of code that assumes objects to be players
This commit is contained in:
parent
b235e4d290
commit
bf8cfce50e
3 changed files with 13 additions and 3 deletions
|
@ -913,7 +913,8 @@ LuaEntitySAO-only: (no-op for other objects)
|
|||
- get_entity_name() (DEPRECATED: Will be removed in a future version)
|
||||
- get_luaentity()
|
||||
Player-only: (no-op for other objects)
|
||||
- get_player_name(): will return nil if is not a player
|
||||
- is_player(): true for players, false for others
|
||||
- get_player_name(): returns "" if is not a player
|
||||
- get_look_dir(): get camera direction as a unit vector
|
||||
- get_look_pitch(): pitch in radians
|
||||
- get_look_yaw(): yaw in radians (wraps around pretty randomly as of now)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue