mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 11:21:01 +00:00
Convert P_TeleportMove use to origin funcs
This commit is contained in:
parent
d476b41dfa
commit
5790168194
7 changed files with 31 additions and 31 deletions
|
@ -579,7 +579,7 @@ void B_RespawnBot(INT32 playernum)
|
|||
player->powers[pw_nocontrol] = sonic->player->powers[pw_nocontrol];
|
||||
player->pflags |= PF_AUTOBRAKE|(sonic->player->pflags & PF_DIRECTIONCHAR);
|
||||
|
||||
P_TeleportMove(tails, x, y, z);
|
||||
P_SetOrigin(tails, x, y, z);
|
||||
if (player->charability == CA_FLY)
|
||||
{
|
||||
P_SetPlayerMobjState(tails, S_PLAY_FLY);
|
||||
|
|
|
@ -1321,7 +1321,7 @@ void OP_ObjectplaceMovement(player_t *player)
|
|||
if (cmd->sidemove != 0)
|
||||
{
|
||||
P_Thrust(player->mo, player->mo->angle-ANGLE_90, (cmd->sidemove*player->mo->scale/MAXPLMOVE)*cv_speed.value);
|
||||
P_TeleportMove(player->mo, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, player->mo->z);
|
||||
P_MoveOrigin(player->mo, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, player->mo->z);
|
||||
player->mo->momx = player->mo->momy = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -13541,7 +13541,7 @@ void A_DustDevilThink(mobj_t *actor)
|
|||
//Chained thinker for the spiralling dust column.
|
||||
while (layer && !P_MobjWasRemoved(layer)) {
|
||||
angle_t fa = layer->angle >> ANGLETOFINESHIFT;
|
||||
P_TeleportMove(layer, layer->x + 5 * FixedMul(scale, FINECOSINE(fa)), layer->y + 5 * FixedMul(scale, FINESINE(fa)), layer->z);
|
||||
P_MoveOrigin(layer, layer->x + 5 * FixedMul(scale, FINECOSINE(fa)), layer->y + 5 * FixedMul(scale, FINESINE(fa)), layer->z);
|
||||
layer->scale = scale;
|
||||
layer->angle += ANG10 / 2;
|
||||
layer->momx = actor->momx;
|
||||
|
|
|
@ -1201,9 +1201,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
return true; // underneath
|
||||
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
P_TeleportMove(thing, thing->x, thing->y, tmthing->z - thing->height - FixedMul(FRACUNIT, tmthing->scale));
|
||||
P_SetOrigin(thing, thing->x, thing->y, tmthing->z - thing->height - FixedMul(FRACUNIT, tmthing->scale));
|
||||
else
|
||||
P_TeleportMove(thing, thing->x, thing->y, tmthing->z + tmthing->height + FixedMul(FRACUNIT, tmthing->scale));
|
||||
P_SetOrigin(thing, thing->x, thing->y, tmthing->z + tmthing->height + FixedMul(FRACUNIT, tmthing->scale));
|
||||
if (thing->flags & MF_SHOOTABLE)
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE);
|
||||
return true;
|
||||
|
|
36
src/p_mobj.c
36
src/p_mobj.c
|
@ -4669,7 +4669,7 @@ static void P_Boss4MoveSpikeballs(mobj_t *mobj, angle_t angle, fixed_t fz)
|
|||
while ((base = base->tracer))
|
||||
{
|
||||
for (seg = base, dist = 172*FRACUNIT, s = 9; seg; seg = seg->hnext, dist += 124*FRACUNIT, --s)
|
||||
P_TeleportMove(seg, mobj->x + P_ReturnThrustX(mobj, angle, dist), mobj->y + P_ReturnThrustY(mobj, angle, dist), bz + FixedMul(fz, FixedDiv(s<<FRACBITS, 9<<FRACBITS)));
|
||||
P_MoveOrigin(seg, mobj->x + P_ReturnThrustX(mobj, angle, dist), mobj->y + P_ReturnThrustY(mobj, angle, dist), bz + FixedMul(fz, FixedDiv(s<<FRACBITS, 9<<FRACBITS)));
|
||||
angle += ANGLE_MAX/3;
|
||||
}
|
||||
}
|
||||
|
@ -5592,7 +5592,7 @@ static void P_Boss9Thinker(mobj_t *mobj)
|
|||
mobj->hprev->destscale = FRACUNIT + (2*TICRATE - mobj->fuse)*(FRACUNIT/2)/TICRATE + FixedMul(FINECOSINE(angle>>ANGLETOFINESHIFT),FRACUNIT/2);
|
||||
P_SetScale(mobj->hprev, mobj->hprev->destscale);
|
||||
|
||||
P_TeleportMove(mobj->hprev, mobj->x, mobj->y, mobj->z + mobj->height/2 - mobj->hprev->height/2);
|
||||
P_MoveOrigin(mobj->hprev, mobj->x, mobj->y, mobj->z + mobj->height/2 - mobj->hprev->height/2);
|
||||
mobj->hprev->momx = mobj->momx;
|
||||
mobj->hprev->momy = mobj->momy;
|
||||
mobj->hprev->momz = mobj->momz;
|
||||
|
@ -7045,7 +7045,7 @@ static void P_UpdateMinecartSegments(mobj_t *mobj)
|
|||
dx = seg->extravalue1;
|
||||
dy = seg->extravalue2;
|
||||
sang = seg->cusval;
|
||||
P_TeleportMove(seg, x + s*dx + c*dy, y - c*dx + s*dy, z);
|
||||
P_MoveOrigin(seg, x + s*dx + c*dy, y - c*dx + s*dy, z);
|
||||
seg->angle = ang + FixedAngle(FRACUNIT*sang);
|
||||
seg->flags2 = (seg->flags2 & ~MF2_DONTDRAW) | (mobj->flags2 & MF2_DONTDRAW);
|
||||
seg = seg->tracer;
|
||||
|
@ -8648,7 +8648,7 @@ static boolean P_EggRobo1Think(mobj_t *mobj)
|
|||
< mobj->scale)
|
||||
S_StartSound(mobj, mobj->info->seesound);
|
||||
|
||||
P_TeleportMove(mobj,
|
||||
P_MoveOrigin(mobj,
|
||||
(15*(mobj->x >> 4)) + (basex >> 4) + P_ReturnThrustX(mobj, mobj->angle, SPECTATORRADIUS >> 4),
|
||||
(15*(mobj->y >> 4)) + (basey >> 4) + P_ReturnThrustY(mobj, mobj->angle, SPECTATORRADIUS >> 4),
|
||||
mobj->z);
|
||||
|
@ -8674,9 +8674,9 @@ static boolean P_EggRobo1Think(mobj_t *mobj)
|
|||
if (!didmove)
|
||||
{
|
||||
if (P_AproxDistance(mobj->x - basex, mobj->y - basey) < mobj->scale)
|
||||
P_TeleportMove(mobj, basex, basey, mobj->z);
|
||||
P_MoveOrigin(mobj, basex, basey, mobj->z);
|
||||
else
|
||||
P_TeleportMove(mobj,
|
||||
P_MoveOrigin(mobj,
|
||||
(15*(mobj->x >> 4)) + (basex >> 4),
|
||||
(15*(mobj->y >> 4)) + (basey >> 4),
|
||||
mobj->z);
|
||||
|
@ -8800,11 +8800,11 @@ static void P_NiGHTSDroneThink(mobj_t *mobj)
|
|||
sparkleoffset = goaloffset + FixedMul(15*FRACUNIT, mobj->scale);
|
||||
}
|
||||
|
||||
P_TeleportMove(goalpost, mobj->x, mobj->y, mobj->z + goaloffset);
|
||||
P_TeleportMove(sparkle, mobj->x, mobj->y, mobj->z + sparkleoffset);
|
||||
P_MoveOrigin(goalpost, mobj->x, mobj->y, mobj->z + goaloffset);
|
||||
P_MoveOrigin(sparkle, mobj->x, mobj->y, mobj->z + sparkleoffset);
|
||||
if (goalpost->movefactor != mobj->z || goalpost->friction != mobj->height)
|
||||
{
|
||||
P_TeleportMove(droneman, mobj->x, mobj->y, mobj->z + dronemanoffset);
|
||||
P_MoveOrigin(droneman, mobj->x, mobj->y, mobj->z + dronemanoffset);
|
||||
goalpost->movefactor = mobj->z;
|
||||
goalpost->friction = mobj->height;
|
||||
}
|
||||
|
@ -8814,12 +8814,12 @@ static void P_NiGHTSDroneThink(mobj_t *mobj)
|
|||
{
|
||||
if (goalpost->x != mobj->x || goalpost->y != mobj->y)
|
||||
{
|
||||
P_TeleportMove(goalpost, mobj->x, mobj->y, goalpost->z);
|
||||
P_TeleportMove(sparkle, mobj->x, mobj->y, sparkle->z);
|
||||
P_MoveOrigin(goalpost, mobj->x, mobj->y, goalpost->z);
|
||||
P_MoveOrigin(sparkle, mobj->x, mobj->y, sparkle->z);
|
||||
}
|
||||
|
||||
if (droneman->x != mobj->x || droneman->y != mobj->y)
|
||||
P_TeleportMove(droneman, mobj->x, mobj->y,
|
||||
P_MoveOrigin(droneman, mobj->x, mobj->y,
|
||||
droneman->z >= mobj->floorz && droneman->z <= mobj->ceilingz ? droneman->z : mobj->z);
|
||||
}
|
||||
|
||||
|
@ -9019,7 +9019,7 @@ static void P_SaloonDoorThink(mobj_t *mobj)
|
|||
fma = (mobj->angle >> ANGLETOFINESHIFT) & FINEMASK;
|
||||
c = 48*FINECOSINE(fma);
|
||||
s = 48*FINESINE(fma);
|
||||
P_TeleportMove(mobj, x + c0 + c, y + s0 + s, z);
|
||||
P_MoveOrigin(mobj, x + c0 + c, y + s0 + s, z);
|
||||
}
|
||||
|
||||
static void P_PyreFlyThink(mobj_t *mobj)
|
||||
|
@ -9461,7 +9461,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
P_RemoveMobj(mobj);
|
||||
return false;
|
||||
}
|
||||
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z - mobj->height);
|
||||
P_MoveOrigin(mobj, mobj->target->x, mobj->target->y, mobj->target->z - mobj->height);
|
||||
break;
|
||||
case MT_HAMMER:
|
||||
if (mobj->z <= mobj->floorz)
|
||||
|
@ -12535,7 +12535,7 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
|||
dronemangoaldiff = max(mobjinfo[MT_NIGHTSDRONE_MAN].height - mobjinfo[MT_NIGHTSDRONE_GOAL].height, 0);
|
||||
|
||||
if (flip && mobj->height != oldheight)
|
||||
P_TeleportMove(mobj, mobj->x, mobj->y, mobj->z - (mobj->height - oldheight));
|
||||
P_MoveOrigin(mobj, mobj->x, mobj->y, mobj->z - (mobj->height - oldheight));
|
||||
|
||||
if (!flip)
|
||||
{
|
||||
|
@ -12604,9 +12604,9 @@ static boolean P_SetupNiGHTSDrone(mapthing_t* mthing, mobj_t* mobj)
|
|||
// correct Z position
|
||||
if (flip)
|
||||
{
|
||||
P_TeleportMove(goalpost, goalpost->x, goalpost->y, mobj->z + goaloffset);
|
||||
P_TeleportMove(sparkle, sparkle->x, sparkle->y, mobj->z + sparkleoffset);
|
||||
P_TeleportMove(droneman, droneman->x, droneman->y, mobj->z + dronemanoffset);
|
||||
P_MoveOrigin(goalpost, goalpost->x, goalpost->y, mobj->z + goaloffset);
|
||||
P_MoveOrigin(sparkle, sparkle->x, sparkle->y, mobj->z + sparkleoffset);
|
||||
P_MoveOrigin(droneman, droneman->x, droneman->y, mobj->z + dronemanoffset);
|
||||
}
|
||||
|
||||
// Remember position preference for later
|
||||
|
|
|
@ -2326,7 +2326,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
if (mo->player)
|
||||
{
|
||||
if (bot) // This might put poor Tails in a wall if he's too far behind! D: But okay, whatever! >:3
|
||||
P_TeleportMove(bot, bot->x + x, bot->y + y, bot->z + z);
|
||||
P_SetOrigin(bot, bot->x + x, bot->y + y, bot->z + z);
|
||||
if (splitscreen && mo->player == &players[secondarydisplayplayer] && camera2.chase)
|
||||
{
|
||||
camera2.x += x;
|
||||
|
@ -2828,7 +2828,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
// Reset bot too.
|
||||
if (bot) {
|
||||
if (line->flags & ML_NOCLIMB)
|
||||
P_TeleportMove(bot, mo->x, mo->y, mo->z);
|
||||
P_SetOrigin(bot, mo->x, mo->y, mo->z);
|
||||
bot->momx = bot->momy = bot->momz = 1;
|
||||
bot->pmomz = 0;
|
||||
bot->player->rmomx = bot->player->rmomy = 1;
|
||||
|
@ -2872,7 +2872,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
|||
// (Teleport them to you so they don't break it.)
|
||||
if (bot && (bot->flags2 & MF2_TWOD) != (mo->flags2 & MF2_TWOD)) {
|
||||
bot->flags2 = (bot->flags2 & ~MF2_TWOD) | (mo->flags2 & MF2_TWOD);
|
||||
P_TeleportMove(bot, mo->x, mo->y, mo->z);
|
||||
P_SetOrigin(bot, mo->x, mo->y, mo->z);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
10
src/p_user.c
10
src/p_user.c
|
@ -7015,7 +7015,7 @@ static void P_MoveNiGHTSToDrone(player_t *player)
|
|||
}
|
||||
|
||||
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
||||
P_TeleportMove(player->mo, player->drone->x, player->drone->y, player->drone->z + zofs);
|
||||
P_MoveOrigin(player->mo, player->drone->x, player->drone->y, player->drone->z + zofs);
|
||||
P_SetTarget(&player->drone, NULL);
|
||||
}
|
||||
|
||||
|
@ -11097,7 +11097,7 @@ static void P_MinecartThink(player_t *player)
|
|||
}
|
||||
|
||||
// Move player to minecart.
|
||||
P_TeleportMove(player->mo, minecart->x - minecart->momx, minecart->y - minecart->momy, minecart->z + max(minecart->momz, 0) + 8*FRACUNIT);
|
||||
P_MoveOrigin(player->mo, minecart->x - minecart->momx, minecart->y - minecart->momy, minecart->z + max(minecart->momz, 0) + 8*FRACUNIT);
|
||||
if (player->powers[pw_carry] != CR_MINECART)
|
||||
return;
|
||||
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
||||
|
@ -11832,7 +11832,7 @@ void P_PlayerThink(player_t *player)
|
|||
// P_TouchSpecialThing case MT_NIGHTSBUMPER, that position is fudged in the time
|
||||
// between that routine in the previous tic
|
||||
// and reaching here in the current tic
|
||||
P_TeleportMove(player->mo, player->mo->hnext->x, player->mo->hnext->y
|
||||
P_MoveOrigin(player->mo, player->mo->hnext->x, player->mo->hnext->y
|
||||
, player->mo->hnext->z + FixedMul(player->mo->hnext->height/4, player->mo->hnext->scale));
|
||||
P_SetTarget(&player->mo->hnext, NULL);
|
||||
}
|
||||
|
@ -12653,7 +12653,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
player->mo->momx = (chain->x - player->mo->x)*2;
|
||||
player->mo->momy = (chain->y - player->mo->y)*2;
|
||||
player->mo->momz = (chain->z - (player->mo->height-chain->height/2) - player->mo->z)*2;
|
||||
P_TeleportMove(player->mo, chain->x, chain->y, chain->z - (player->mo->height-chain->height/2));
|
||||
P_MoveOrigin(player->mo, chain->x, chain->y, chain->z - (player->mo->height-chain->height/2));
|
||||
if (!player->powers[pw_flashing]) // handle getting hurt
|
||||
{
|
||||
player->pflags |= PF_JUMPED;
|
||||
|
@ -12724,7 +12724,7 @@ void P_PlayerAfterThink(player_t *player)
|
|||
mo->tics = walktics;
|
||||
}
|
||||
|
||||
P_TeleportMove(player->mo, rock->x, rock->y, rock->z + ((mo->eflags & MFE_VERTICALFLIP) ? -mo->height : rock->height));
|
||||
P_MoveOrigin(player->mo, rock->x, rock->y, rock->z + ((mo->eflags & MFE_VERTICALFLIP) ? -mo->height : rock->height));
|
||||
break;
|
||||
}
|
||||
case CR_PTERABYTE: // being carried by a Pterabyte
|
||||
|
|
Loading…
Reference in a new issue