From 661da15146d4385891fbc4d7e82a518b2bc23034 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 9 Jun 2016 18:16:13 +0100 Subject: [PATCH] Reinforcing encapsulation I originally broke down to allow for P_GetMobjGravity. When I first wrote this, I thought the .h file that contained a function declaration needed to have the same name as the .c file the function was in. Now I know that's not the case, off to p_local.h with you. --- src/lua_baselib.c | 1 - src/p_local.h | 1 + src/p_mobj.h | 3 --- src/p_slopes.c | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index c88ece50..e8e8fd02 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -13,7 +13,6 @@ #include "doomdef.h" #ifdef HAVE_BLUA #include "p_local.h" -#include "p_mobj.h" // So we can have P_GetMobjGravity #include "p_setup.h" // So we can have P_SetupLevelSky #include "z_zone.h" #include "r_main.h" diff --git a/src/p_local.h b/src/p_local.h index c8930aed..5ffd473f 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -251,6 +251,7 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 aimtype #endif void P_ColorTeamMissile(mobj_t *missile, player_t *source); SINT8 P_MobjFlip(mobj_t *mobj); +fixed_t P_GetMobjGravity(mobj_t *mo); boolean P_WeaponOrPanel(mobjtype_t type); boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled); diff --git a/src/p_mobj.h b/src/p_mobj.h index de7f0c8d..9542ce8b 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -425,9 +425,6 @@ void P_AddCachedAction(mobj_t *mobj, INT32 statenum); // check mobj against water content, before movement code void P_MobjCheckWater(mobj_t *mobj); -// get mobj gravity -fixed_t P_GetMobjGravity(mobj_t *mo); - // Player spawn points void P_SpawnPlayer(INT32 playernum); void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing); diff --git a/src/p_slopes.c b/src/p_slopes.c index b6338d95..8df94e75 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -16,7 +16,6 @@ #include "m_bbox.h" #include "z_zone.h" #include "p_local.h" -#include "p_mobj.h" #include "p_spec.h" #include "p_slopes.h" #include "p_setup.h"