From 95e7e59179b6d5ea2b1d91641f993e150cc35fdd Mon Sep 17 00:00:00 2001 From: Wolfy Date: Tue, 7 Apr 2020 05:24:38 -0500 Subject: [PATCH] Remove stupid dumbfuck #ifdefs WHY THE FUCK DID THESE BREAK IT AAAAAAAAAAAAAAAAAAA --- src/lua_baselib.c | 4 ---- src/lua_hook.h | 4 ---- src/lua_hooklib.c | 6 ------ src/lua_script.h | 2 -- src/s_sound.c | 4 ++-- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index e49b0898..d7292cd6 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1898,7 +1898,6 @@ static int lib_sSpeedMusic(lua_State *L) return 1; } -#ifdef HAVE_LUA_MUSICPLUS static int lib_sMusicType(lua_State *L) { player_t *player = NULL; @@ -2283,7 +2282,6 @@ static int lib_sFadeOutStopMusic(lua_State *L) return 1; } -#endif static int lib_sOriginPlaying(lua_State *L) { void *origin = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); @@ -3114,7 +3112,6 @@ static luaL_Reg lib[] = { {"S_ShowMusicCredit",lib_sShowMusicCredit}, {"S_ChangeMusic",lib_sChangeMusic}, {"S_SpeedMusic",lib_sSpeedMusic}, -#ifdef HAVE_LUA_MUSICPLUS {"S_MusicType",lib_sMusicType}, {"S_MusicPlaying",lib_sMusicPlaying}, {"S_MusicPaused",lib_sMusicPaused}, @@ -3133,7 +3130,6 @@ static luaL_Reg lib[] = { {"S_StopFadingMusic",lib_sStopFadingMusic}, {"S_FadeMusic",lib_sFadeMusic}, {"S_FadeOutStopMusic",lib_sFadeOutStopMusic}, -#endif {"S_OriginPlaying",lib_sOriginPlaying}, {"S_IdPlaying",lib_sIdPlaying}, {"S_SoundPlaying",lib_sSoundPlaying}, diff --git a/src/lua_hook.h b/src/lua_hook.h index afe9b317..6af3941f 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -44,9 +44,7 @@ enum hook { hook_HurtMsg, hook_PlayerSpawn, hook_PlayerQuit, -#ifdef HAVE_LUA_MUSICPLUS hook_MusicChange, -#endif hook_ShouldSpin, //SRB2KART hook_ShouldExplode, //SRB2KART hook_ShouldSquish, //SRB2KART @@ -93,10 +91,8 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute); 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 void LUAh_PlayerQuit(player_t *plr, int reason); // Hook for player quitting -#ifdef HAVE_LUA_MUSICPLUS boolean LUAh_MusicChange(const char *oldname, char *newname, UINT16 *mflags, boolean *looping, UINT32 *position, UINT32 *prefadems, UINT32 *fadeinms); // Hook for music changes -#endif UINT8 LUAh_ShouldSpin(player_t *player, mobj_t *inflictor, mobj_t *source); // SRB2KART: Should player be spun out? UINT8 LUAh_ShouldExplode(player_t *player, mobj_t *inflictor, mobj_t *source); // SRB2KART: Should player be exploded? diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 3f4ae987..41a436e0 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -55,9 +55,7 @@ const char *const hookNames[hook_MAX+1] = { "HurtMsg", "PlayerSpawn", "PlayerQuit", -#ifdef HAVE_LUA_MUSICPLUS "MusicChange", -#endif "ShouldSpin", "ShouldExplode", "ShouldSquish", @@ -1216,8 +1214,6 @@ void LUAh_PlayerQuit(player_t *plr, int reason) lua_settop(gL, 0); } -#ifdef HAVE_LUA_MUSICPLUS - // Hook for music changes boolean LUAh_MusicChange(const char *oldname, char *newname, UINT16 *mflags, boolean *looping, UINT32 *position, UINT32 *prefadems, UINT32 *fadeinms) @@ -1277,8 +1273,6 @@ boolean LUAh_MusicChange(const char *oldname, char *newname, UINT16 *mflags, boo return hooked; } -#endif - // Hook for K_SpinPlayer. Determines if yes or no we should get damaged reguardless of circumstances. UINT8 LUAh_ShouldSpin(player_t *player, mobj_t *inflictor, mobj_t *source) { diff --git a/src/lua_script.h b/src/lua_script.h index 1d49413b..b3ca16bc 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -98,6 +98,4 @@ void COM_Lua_f(void); }\ } -#define HAVE_LUA_MUSICPLUS - #endif diff --git a/src/s_sound.c b/src/s_sound.c index 184f2529..2c96d389 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -38,7 +38,7 @@ extern INT32 msg_id; #include "p_local.h" // camera info #include "m_misc.h" // for tunes command -#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) +#ifdef HAVE_BLUA #include "lua_hook.h" // MusicChange hook #endif @@ -1989,7 +1989,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32 return; strncpy(newmusic, mmusic, 7); -#if defined(HAVE_BLUA) && defined(HAVE_LUA_MUSICPLUS) +#ifdef HAVE_BLUA if(LUAh_MusicChange(music_name, newmusic, &mflags, &looping, &position, &prefadems, &fadeinms)) return; #endif