diff --git a/src/lua_hook.h b/src/lua_hook.h index e0f08d175..cbeaa6868 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -44,6 +44,7 @@ enum hook { hook_HurtMsg, hook_PlayerSpawn, hook_ShieldSpawn, + hook_ShieldSpecial, hook_MAX // last hook }; @@ -79,5 +80,6 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook fo boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer #define LUAh_ShieldSpawn(player) LUAh_PlayerHook(player, hook_ShieldSpawn) // Hook for P_SpawnShieldOrb +#define LUAh_ShieldSpecial(player) LUAh_PlayerHook(player, hook_ShieldSpecial) // Hook for shield abilities #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 1065f193a..ac0e555f7 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -55,6 +55,7 @@ const char *const hookNames[hook_MAX+1] = { "HurtMsg", "PlayerSpawn", "ShieldSpawn", + "ShieldSpecial", NULL }; diff --git a/src/p_user.c b/src/p_user.c index 5aa50458e..55d2ad544 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6978,10 +6978,14 @@ static void P_MovePlayer(player_t *player) //STUFF! // /////////////////////////// - if (player->pflags & PF_JUMPED) + if (player->pflags & PF_JUMPED && !player->exiting && player->mo->health) { if (cmd->buttons & BT_USE) // Spin button effects { +#ifdef HAVE_BLUA + if (LUAh_ShieldSpecial(player)) + return; +#endif if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped {