Skip to content

Commit

Permalink
* Allow passing of jump point as hook parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbens committed Jan 27, 2012
1 parent 6fe5de0 commit 61e2a19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ static int hook_parseParam( lua_State *L, HookParam *param )
case HOOK_PARAM_ASSET:
lua_pushplanet( L, param[n].u.la );
break;
case HOOK_PARAM_JUMP:
lua_pushjump( L, param[n].u.lj );
break;

default:
WARN( "Unknown Lua parameter type." );
Expand Down
3 changes: 3 additions & 0 deletions src/hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "nlua_pilot.h"
#include "nlua_faction.h"
#include "nlua_planet.h"
#include "nlua_jump.h"


#define HOOK_MAX_PARAM 3 /**< Maximum hook params, to avoid dynamic allocation. */
Expand All @@ -28,6 +29,7 @@ typedef enum HookParamType_e {
HOOK_PARAM_PILOT, /**< Pilot hook parameter. */
HOOK_PARAM_FACTION, /**< Faction hook parameter. */
HOOK_PARAM_ASSET, /**< Asset hook parameter. */
HOOK_PARAM_JUMP, /**< Jump point hook parameter. */
HOOK_PARAM_SENTINEL /**< Enum sentinel. */
} HookParamType;

Expand All @@ -43,6 +45,7 @@ typedef struct HookParam_s {
LuaPilot lp; /**< Hook parameter pilot data. */
LuaFaction lf; /**< Hook parameter faction data. */
LuaPlanet la; /**< Hook parameter planet data. */
LuaJump lj; /**< Hook parameter jump data. */
} u; /**< Hook parameter data. */
} HookParam;

Expand Down

0 comments on commit 61e2a19

Please sign in to comment.