From 95c7690a40352e5cc73c7e313ffd5c487df48de7 Mon Sep 17 00:00:00 2001 From: Nev3r Date: Wed, 15 Apr 2020 10:16:49 +0200 Subject: [PATCH] Remove P_FindSpecialLineFromTag() --- src/lua_baselib.c | 12 ------------ src/p_spec.c | 32 -------------------------------- src/p_spec.h | 2 -- 3 files changed, 46 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 48a503828..884588160 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1915,17 +1915,6 @@ static int lib_pFindHighestCeilingSurrounding(lua_State *L) return 1; } -static int lib_pFindSpecialLineFromTag(lua_State *L) -{ - INT16 special = (INT16)luaL_checkinteger(L, 1); - INT16 line = (INT16)luaL_checkinteger(L, 2); - INT32 start = (INT32)luaL_optinteger(L, 3, -1); - NOHUD - INLEVEL - lua_pushinteger(L, P_FindSpecialLineFromTag(special, line, start)); - return 1; -} - static int lib_pSwitchWeather(lua_State *L) { INT32 weathernum = (INT32)luaL_checkinteger(L, 1); @@ -3213,7 +3202,6 @@ static luaL_Reg lib[] = { {"P_FindNextLowestFloor",lib_pFindNextLowestFloor}, {"P_FindLowestCeilingSurrounding",lib_pFindLowestCeilingSurrounding}, {"P_FindHighestCeilingSurrounding",lib_pFindHighestCeilingSurrounding}, - {"P_FindSpecialLineFromTag",lib_pFindSpecialLineFromTag}, {"P_SwitchWeather",lib_pSwitchWeather}, {"P_LinedefExecute",lib_pLinedefExecute}, {"P_SpawnLightningFlash",lib_pSpawnLightningFlash}, diff --git a/src/p_spec.c b/src/p_spec.c index 1977e7a89..2e8f1b685 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -988,38 +988,6 @@ static sector_t *P_FindModelCeilingSector(fixed_t ceildestheight, INT32 secnum) } #endif -// -// P_FindSpecialLineFromTag -// -INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start) -{ - if (tag == -1) - { - start++; - - // This redundant check stops the compiler from complaining about function expansion - // elsewhere for some reason and everything is awful - if (start >= (INT32)numlines) - return -1; - - while (start < (INT32)numlines && lines[start].special != special) - start++; - - if (start >= (INT32)numlines) - return -1; - - return start; - } - else - { - start = start >= 0 ? lines[start].nexttag : - lines[(unsigned)tag % numlines].firsttag; - while (start >= 0 && (lines[start].tag != tag || lines[start].special != special)) - start = lines[start].nexttag; - return start; - } -} - // haleyjd: temporary define #ifdef POLYOBJECTS diff --git a/src/p_spec.h b/src/p_spec.h index 271c04c08..1e9ff1c41 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -55,8 +55,6 @@ fixed_t P_FindNextLowestFloor(sector_t *sec, fixed_t currentheight); fixed_t P_FindLowestCeilingSurrounding(sector_t *sec); fixed_t P_FindHighestCeilingSurrounding(sector_t *sec); -INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start); - INT32 P_FindMinSurroundingLight(sector_t *sector, INT32 max); void P_SetupSignExit(player_t *player);