[Add] player.getPilot() to Lua API.
This commit is contained in:
		
							parent
							
								
									47a8efa9ee
								
							
						
					
					
						commit
						0c238662c2
					
				| @ -114,6 +114,7 @@ static int player_modFactionRaw(lua_State* L); | |||||||
| static int player_getFaction(lua_State* L); | static int player_getFaction(lua_State* L); | ||||||
| static int player_getRating(lua_State* L); | static int player_getRating(lua_State* L); | ||||||
| static int player_getPosition(lua_State* L); | static int player_getPosition(lua_State* L); | ||||||
|  | static int player_getPilot(lua_State* L); | ||||||
| static const luaL_reg player_methods[] = { | static const luaL_reg player_methods[] = { | ||||||
|   { "name",           player_getname        }, |   { "name",           player_getname        }, | ||||||
|   { "ship",           player_shipname       }, |   { "ship",           player_shipname       }, | ||||||
| @ -127,6 +128,7 @@ static const luaL_reg player_methods[] = { | |||||||
|   { "getFaction",     player_getFaction     }, |   { "getFaction",     player_getFaction     }, | ||||||
|   { "getRating",      player_getRating      }, |   { "getRating",      player_getRating      }, | ||||||
|   { "pos",            player_getPosition    }, |   { "pos",            player_getPosition    }, | ||||||
|  |   { "pilot",          player_getPilot       }, | ||||||
|   { 0, 0 } |   { 0, 0 } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -844,6 +846,21 @@ static int player_getPosition(lua_State* L) { | |||||||
|   return 1; |   return 1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /**
 | ||||||
|  |  * @fn static int player_getPilot(lua_State* L) | ||||||
|  |  * | ||||||
|  |  * @brief Pilot getPilot(nil) | ||||||
|  |  * | ||||||
|  |  * Get the players associated pilot. | ||||||
|  |  *    @return The players pilot. | ||||||
|  |  */ | ||||||
|  | static int player_getPilot(lua_State* L) { | ||||||
|  |   LuaPilot lp; | ||||||
|  |   lp.pilot = PLAYER_ID; | ||||||
|  |   lua_pushpilot(L, lp); | ||||||
|  |   return 1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /**
 | /**
 | ||||||
|  * @fn static int hook_pilot(lua_State* L) |  * @fn static int hook_pilot(lua_State* L) | ||||||
|  * @ingroup HOOK |  * @ingroup HOOK | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Allanis
						Allanis