From ecec1e8a8fd1c29c6bb5fba03697562a0265346a Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 10 Aug 2020 17:22:55 -0400 Subject: [PATCH] OK the compiler still didn't like it, so just properly remove it entirely. --- src/lua_baselib.c | 24 ------------------------ src/p_enemy.c | 2 +- src/p_local.h | 29 +++-------------------------- src/p_mobj.c | 28 ++++++++++++---------------- src/p_user.c | 12 ++++++------ 5 files changed, 22 insertions(+), 73 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2e84227db..ddd98c928 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -997,28 +997,6 @@ static int lib_pPlayerZMovement(lua_State *L) // P_USER //////////// -static int lib_pGetPlayerHeight(lua_State *L) -{ - player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - //HUDSAFE - INLEVEL - if (!player) - return LUA_ErrInvalid(L, "player_t"); - lua_pushfixed(L, P_GetPlayerHeight(player)); - return 1; -} - -static int lib_pGetPlayerSpinHeight(lua_State *L) -{ - player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - //HUDSAFE - INLEVEL - if (!player) - return LUA_ErrInvalid(L, "player_t"); - lua_pushfixed(L, P_GetPlayerSpinHeight(player)); - return 1; -} - static int lib_pAddPlayerScore(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -4103,8 +4081,6 @@ static luaL_Reg lib[] = { {"P_PlayerZMovement",lib_pPlayerZMovement}, // p_user - {"P_GetPlayerHeight",lib_pGetPlayerHeight}, - {"P_GetPlayerSpinHeight",lib_pGetPlayerSpinHeight}, {"P_AddPlayerScore",lib_pAddPlayerScore}, {"P_StealPlayerScore",lib_pStealPlayerScore}, {"P_GetJumpFlags",lib_pGetJumpFlags}, diff --git a/src/p_enemy.c b/src/p_enemy.c index 9c9509225..49366f94c 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -7595,7 +7595,7 @@ void A_Boss2PogoTarget(mobj_t *actor) // Remember, kids! // Reduced down Calculus lets you avoid bad 'logic math' loops! //airtime = FixedDiv(-actor->momz<<1, gravityadd)<<1; // going from 0 to 0 is much simpler - zoffs = (P_GetPlayerHeight(actor->target->player)>>1) + (actor->target->floorz - actor->floorz); // offset by the difference in floor height plus half the player height, + zoffs = (actor->target->height>>1) + (actor->target->floorz - actor->floorz); // offset by the difference in floor height plus half the player height, airtime = FixedDiv((-actor->momz - FixedSqrt(FixedMul(actor->momz,actor->momz)+zoffs)), gravityadd)<<1; // to try and land on their head rather than on their feet actor->angle = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y); diff --git a/src/p_local.h b/src/p_local.h index 2c7b8dd76..0178bfa6d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -61,9 +61,6 @@ #define mariomode (maptol & TOL_MARIO) -#define P_GetPlayerHeight(player) FixedMul(mobjinfo[MT_PLAYER].height, player->mo->scale) -#define P_GetPlayerSpinHeight(player) FixedMul(mobjinfo[MT_PLAYER].height, player->mo->scale) - typedef enum { THINK_POLYOBJ, @@ -134,31 +131,11 @@ struct demofreecam_s { extern struct demofreecam_s democam; extern camera_t camera[MAXSPLITSCREENPLAYERS]; -extern consvar_t cv_cam_dist, cv_cam_still, cv_cam_height; -extern consvar_t cv_cam_speed, cv_cam_rotate, cv_cam_rotspeed, cv_cam_turnmultiplier, cv_cam_orbit, cv_cam_adjust; +extern consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS], cv_cam_still[MAXSPLITSCREENPLAYERS], cv_cam_height[MAXSPLITSCREENPLAYERS]; +extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS], cv_cam_rotate[MAXSPLITSCREENPLAYERS]; -extern consvar_t cv_cam2_dist, cv_cam2_still, cv_cam2_height; -extern consvar_t cv_cam2_speed, cv_cam2_rotate, cv_cam2_rotspeed, cv_cam2_turnmultiplier, cv_cam2_orbit, cv_cam2_adjust; +extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS]; -extern consvar_t cv_cam_savedist[2][2], cv_cam_saveheight[2][2]; -void CV_UpdateCamDist(void); -void CV_UpdateCam2Dist(void); - -extern consvar_t cv_cam3_dist, cv_cam3_still, cv_cam3_height; -extern consvar_t cv_cam3_speed, cv_cam3_rotate, cv_cam3_rotspeed; - -extern consvar_t cv_cam4_dist, cv_cam4_still, cv_cam4_height; -extern consvar_t cv_cam4_speed, cv_cam4_rotate, cv_cam4_rotspeed; - -extern fixed_t t_cam_dist, t_cam_height, t_cam_rotate; -extern fixed_t t_cam2_dist, t_cam2_height, t_cam2_rotate; -extern fixed_t t_cam3_dist, t_cam3_height, t_cam3_rotate; -extern fixed_t t_cam4_dist, t_cam4_height, t_cam4_rotate; - -fixed_t P_GetPlayerHeight(player_t *player); -fixed_t P_GetPlayerSpinHeight(player_t *player); -INT32 P_GetPlayerControlDirection(player_t *player); ->>>>>>> srb2/next void P_AddPlayerScore(player_t *player, UINT32 amount); void P_StealPlayerScore(player_t *player, UINT32 amount); void P_ResetCamera(player_t *player, camera_t *thiscam); diff --git a/src/p_mobj.c b/src/p_mobj.c index eca36669a..7091269db 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2996,7 +2996,7 @@ void P_MobjCheckWater(mobj_t *mobj) sector_t *sector = mobj->subsector->sector; ffloor_t *rover; player_t *p = mobj->player; // Will just be null if not a player. - fixed_t height = (p ? P_GetPlayerHeight(p) : mobj->height); // for players, calculation height does not necessarily match actual height for gameplay reasons (spin, etc) + fixed_t height = mobj->height; boolean wasgroundpounding = (p && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY)); // Default if no water exists. @@ -6522,9 +6522,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) thing->x = thing->target->x; thing->y = thing->target->y; if (thing->eflags & MFE_VERTICALFLIP) - thing->z = thing->target->z + (thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) - FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z + (thing->target->height - thing->height - FixedMul(2*FRACUNIT, thing->target->scale); else - thing->z = thing->target->z - (FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) + FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z + FixedMul(2*FRACUNIT, thing->target->scale); P_SetThingPosition(thing); P_CheckPosition(thing, thing->x, thing->y); @@ -7967,12 +7967,12 @@ static void P_MobjSceneryThink(mobj_t *mobj) if (!(mobj->target->eflags & MFE_VERTICALFLIP)) { - mobj->z = mobj->target->z + P_GetPlayerHeight(mobj->target->player) + (16*mobj->target->scale); + mobj->z = mobj->target->z + mobj->target->height + (16*mobj->target->scale); mobj->eflags &= ~MFE_VERTICALFLIP; } else { - mobj->z = mobj->target->z - P_GetPlayerHeight(mobj->target->player) - (16*mobj->target->scale); + mobj->z = mobj->target->z - mobj->target->height - (16*mobj->target->scale); mobj->eflags |= MFE_VERTICALFLIP; } P_SetThingPosition(mobj); @@ -8164,12 +8164,12 @@ static void P_MobjSceneryThink(mobj_t *mobj) if (!(mobj->target->eflags & MFE_VERTICALFLIP)) { - mobj->z = mobj->target->z + (P_GetPlayerHeight(mobj->target->player)) + (16*mobj->target->scale) + (64*scale); + mobj->z = mobj->target->z + mobj->target->height + (16*mobj->target->scale) + (64*scale); mobj->eflags &= ~MFE_VERTICALFLIP; } else { - mobj->z = mobj->target->z - (P_GetPlayerHeight(mobj->target->player)) - (16*mobj->target->scale) - (64*scale); + mobj->z = mobj->target->z - mobj->target->height - (16*mobj->target->scale) - (64*scale); mobj->eflags |= MFE_VERTICALFLIP; } P_SetThingPosition(mobj); @@ -12384,12 +12384,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj) if (!(mobj->target->eflags & MFE_VERTICALFLIP)) { - mobj->z = mobj->target->z + P_GetPlayerHeight(mobj->target->player) + (16*mobj->target->scale); + mobj->z = mobj->target->z + mobj->target->height + (16*mobj->target->scale); mobj->eflags &= ~MFE_VERTICALFLIP; } else { - mobj->z = mobj->target->z - P_GetPlayerHeight(mobj->target->player) - (16*mobj->target->scale); + mobj->z = mobj->target->z - mobj->target->height - (16*mobj->target->scale); mobj->eflags |= MFE_VERTICALFLIP; } P_SetThingPosition(mobj); @@ -12581,12 +12581,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj) if (!(mobj->target->eflags & MFE_VERTICALFLIP)) { - mobj->z = mobj->target->z + (P_GetPlayerHeight(mobj->target->player)) + (16*mobj->target->scale) + (64*scale); + mobj->z = mobj->target->z + mobj->target->height + (16*mobj->target->scale) + (64*scale); mobj->eflags &= ~MFE_VERTICALFLIP; } else { - mobj->z = mobj->target->z - (P_GetPlayerHeight(mobj->target->player)) - (16*mobj->target->scale) - (64*scale); + mobj->z = mobj->target->z - mobj->target->height - (16*mobj->target->scale) - (64*scale); mobj->eflags |= MFE_VERTICALFLIP; } P_SetThingPosition(mobj); @@ -14761,10 +14761,6 @@ void P_SpawnPlayer(INT32 playernum) P_SetScale(mobj, mobj->destscale); P_FlashPal(p, 0, 0); // Resets - // Set bounds accurately. - mobj->radius = FixedMul(skins[p->skin].radius, mobj->scale); - mobj->height = P_GetPlayerHeight(p); - if (!leveltime && !p->spectator && ((maptol & TOL_NIGHTS) == TOL_NIGHTS) != (G_IsSpecialStage(gamemap))) // non-special NiGHTS stage or special non-NiGHTS stage { if (maptol & TOL_NIGHTS) @@ -14790,7 +14786,7 @@ void P_SpawnPlayer(INT32 playernum) if (G_BattleGametype()) // SRB2kart { - mobj_t *overheadarrow = P_SpawnMobj(mobj->x, mobj->y, mobj->z + P_GetPlayerHeight(p)+16*FRACUNIT, MT_PLAYERARROW); + mobj_t *overheadarrow = P_SpawnMobj(mobj->x, mobj->y, mobj->z + mobj->height + 16*FRACUNIT, MT_PLAYERARROW); P_SetTarget(&overheadarrow->target, mobj); overheadarrow->flags2 |= MF2_DONTDRAW; P_SetScale(overheadarrow, mobj->destscale); diff --git a/src/p_user.c b/src/p_user.c index b1f2c4c8e..d2940c1ab 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1749,10 +1749,10 @@ static void P_CheckBouncySectors(player_t *player) newmom = -8*FRACUNIT; } - if (newmom > P_GetPlayerHeight(player)/2) - newmom = P_GetPlayerHeight(player)/2; - else if (newmom < -P_GetPlayerHeight(player)/2) - newmom = -P_GetPlayerHeight(player)/2; + if (newmom > player->mo->height/2) + newmom = player->mo->height/2; + else if (newmom < -player->mo->height/2) + newmom = -player->mo->height/2; momentum.z = newmom*2; @@ -3829,13 +3829,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (mo->eflags & MFE_VERTICALFLIP) { - angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - player->mo->height); if (thiscam->pitch < ANGLE_180 && thiscam->pitch > angle) angle += (thiscam->pitch - angle)/2; } else { - angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + player->mo->height); if (thiscam->pitch >= ANGLE_180 && thiscam->pitch < angle) angle -= (angle - thiscam->pitch)/2; }