mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-11 03:01:12 +00:00
- cleanup, part 3.
This commit is contained in:
parent
dd7544c7a6
commit
1f49f62d75
8 changed files with 32 additions and 36 deletions
|
@ -115,8 +115,7 @@ void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
|
|||
{
|
||||
player_struct* p = &ps[myconnectindex];
|
||||
|
||||
p->player_set_int_xy({ x, y});
|
||||
p->player_set_int_z(z);
|
||||
p->pos = DVector3(x, y, z);
|
||||
p->backupxyz();
|
||||
|
||||
if (ang != INT_MIN)
|
||||
|
|
|
@ -1981,8 +1981,7 @@ int ParseState::parse(void)
|
|||
break;
|
||||
case concmd_larrybird:
|
||||
insptr++;
|
||||
ps[g_p].player_set_int_z(ps[g_p].GetActor()->sector()->int_ceilingz());
|
||||
ps[g_p].GetActor()->set_int_z(ps[g_p].player_int_pos().Z);
|
||||
ps[g_p].GetActor()->spr.pos.Z = ps[g_p].pos.Z = ps[g_p].GetActor()->sector()->ceilingz;
|
||||
break;
|
||||
case concmd_destroyit:
|
||||
insptr++;
|
||||
|
@ -2224,12 +2223,12 @@ int ParseState::parse(void)
|
|||
{
|
||||
// I am not convinced this is even remotely smart to be executed from here..
|
||||
pickrandomspot(g_p);
|
||||
g_ac->set_int_pos(ps[g_p].player_int_pos());
|
||||
g_ac->spr.pos = ps[g_p].pos;
|
||||
ps[g_p].backupxyz();
|
||||
ps[g_p].setbobpos();
|
||||
g_ac->backuppos();
|
||||
updatesector(ps[g_p].player_int_pos().X, ps[g_p].player_int_pos().Y, &ps[g_p].cursector);
|
||||
SetActor(ps[g_p].GetActor(), vec3_t( ps[g_p].player_int_pos().X, ps[g_p].player_int_pos().Y, ps[g_p].player_int_pos().Z + gs.int_playerheight ));
|
||||
updatesector(ps[g_p].pos, &ps[g_p].cursector);
|
||||
SetActor(ps[g_p].GetActor(), ps[g_p].pos.plusZ(gs.playerheight ));
|
||||
g_ac->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
|
||||
g_ac->spr.shade = -12;
|
||||
|
|
|
@ -208,7 +208,7 @@ inline bool playrunning()
|
|||
inline void doslopetilting(player_struct* p, double const scaleAdjust = 1)
|
||||
{
|
||||
bool const canslopetilt = p->on_ground && p->insector() && p->cursector->lotag != ST_2_UNDERWATER && (p->cursector->floorstat & CSTAT_SECTOR_SLOPE);
|
||||
p->horizon.calcviewpitch(p->player_int_pos().vec2, p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursector, scaleAdjust);
|
||||
p->horizon.calcviewpitch(p->pos, p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursector, scaleAdjust);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -564,8 +564,8 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
|
|||
if (actor->spr.pal != 1)
|
||||
{
|
||||
SetPlayerPal(p, PalEntry(63, 63, 0, 0));
|
||||
p->player_add_int_z(-(16 << 8));
|
||||
actor->add_int_z(-(16 << 8));
|
||||
p->pos.Z -= 16;
|
||||
actor->spr.pos.Z -= 16;
|
||||
}
|
||||
#if 0
|
||||
if (ud.recstat == 1 && ud.multimode < 2)
|
||||
|
@ -613,7 +613,7 @@ void playerisdead(int snum, int psectlotag, int fz, int cz)
|
|||
if (p->on_warping_sector == 0)
|
||||
{
|
||||
if (abs(p->player_int_pos().Z - fz) > (gs.int_playerheight >> 1))
|
||||
p->player_add_int_z(348);
|
||||
p->pos.Z += 348/ 256.;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -710,7 +710,7 @@ void playerCrouch(int snum)
|
|||
OnEvent(EVENT_CROUCH, snum, p->GetActor(), -1);
|
||||
if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0)
|
||||
{
|
||||
p->player_add_int_z((2048 + 768));
|
||||
p->pos.Z += 8 + 3;
|
||||
p->crack_time = CRACK_TIME;
|
||||
}
|
||||
}
|
||||
|
@ -769,14 +769,16 @@ void player_struct::backuppos(bool noclipping)
|
|||
{
|
||||
if (!noclipping)
|
||||
{
|
||||
backupxy();
|
||||
opos.X = pos.X;
|
||||
opos.Y = pos.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
restorexy();
|
||||
pos.X = opos.X;
|
||||
pos.Y = opos.Y;
|
||||
}
|
||||
|
||||
backupz();
|
||||
opos.Z = pos.Z;
|
||||
bobpos.X = player_int_pos().X;
|
||||
bobpos.Y = player_int_pos().Y;
|
||||
opyoff = pyoff;
|
||||
|
|
|
@ -1667,7 +1667,6 @@ void checkweapons_d(struct player_struct* p)
|
|||
|
||||
static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz, int cz, int shrunk)
|
||||
{
|
||||
int j;
|
||||
auto p = &ps[snum];
|
||||
auto pact = p->GetActor();
|
||||
p->on_ground = 0;
|
||||
|
@ -1687,13 +1686,14 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
|
|||
if (p->jetpack_on < 11)
|
||||
{
|
||||
p->jetpack_on++;
|
||||
p->player_add_int_z(-(p->jetpack_on << 7)); //Goin up
|
||||
p->pos.Z -= (p->jetpack_on * 0.5); //Goin up
|
||||
}
|
||||
else if (p->jetpack_on == 11 && !S_CheckActorSoundPlaying(pact, DUKE_JETPACK_IDLE))
|
||||
S_PlayActorSound(DUKE_JETPACK_IDLE, pact);
|
||||
|
||||
if (shrunk) j = 512;
|
||||
else j = 2048;
|
||||
double dist;
|
||||
if (shrunk) dist = 2;
|
||||
else dist = 8;
|
||||
|
||||
if (actions & SB_JUMP) //A (soar high)
|
||||
{
|
||||
|
@ -1702,7 +1702,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
|
|||
OnEvent(EVENT_SOARUP, snum, p->GetActor(), -1);
|
||||
if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0)
|
||||
{
|
||||
p->player_add_int_z(-j);
|
||||
p->pos.Z -= dist;
|
||||
p->crack_time = CRACK_TIME;
|
||||
}
|
||||
}
|
||||
|
@ -1714,7 +1714,7 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
|
|||
OnEvent(EVENT_SOARDOWN, snum, p->GetActor(), -1);
|
||||
if (GetGameVarID(g_iReturnVarID, p->GetActor(), snum).value() == 0)
|
||||
{
|
||||
p->player_add_int_z(j);
|
||||
p->pos.Z += dist;
|
||||
p->crack_time = CRACK_TIME;
|
||||
}
|
||||
}
|
||||
|
@ -1727,9 +1727,9 @@ static void operateJetpack(int snum, ESyncBits actions, int psectlotag, int fz,
|
|||
p->scuba_on = 0;
|
||||
|
||||
if (p->player_int_pos().Z > (fz - (k << 8)))
|
||||
p->player_add_int_z(((fz - (k << 8)) - p->player_int_pos().Z) >> 1);
|
||||
p->pos.Z += (((fz - (k << 8)) - p->player_int_pos().Z) >> 1) * zinttoworld;
|
||||
if (p->player_int_pos().Z < (pact->actor_int_ceilingz() + (18 << 8)))
|
||||
p->player_set_int_z(pact->actor_int_ceilingz() + (18 << 8));
|
||||
p->pos.Z = pact->ceilingz + 18;
|
||||
|
||||
}
|
||||
|
||||
|
@ -2034,7 +2034,7 @@ int operateTripbomb(int snum)
|
|||
if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag <= 2) || (!hit.hitWall->twoSided() && hit.hitSector->lotag <= 2))
|
||||
if (((hit.hitpos.X - p->player_int_pos().X) * (hit.hitpos.X - p->player_int_pos().X) + (hit.hitpos.Y - p->player_int_pos().Y) * (hit.hitpos.Y - p->player_int_pos().Y)) < (290 * 290))
|
||||
{
|
||||
p->player_set_int_z(p->player_int_opos().Z);
|
||||
p->pos.Z = p->opos.Z;
|
||||
p->vel.Z = 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -2572,7 +2572,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
case TRIPBOMB_WEAPON: // Claymore in NAM
|
||||
if (p->kickback_pic < 4)
|
||||
{
|
||||
p->player_set_int_z(p->player_int_opos().Z);
|
||||
p->pos.Z = p->opos.Z;
|
||||
p->vel.Z = 0;
|
||||
if (p->kickback_pic == 3)
|
||||
fi.shoot(pact, HANDHOLDINGLASER);
|
||||
|
@ -3034,7 +3034,7 @@ HORIZONLY:
|
|||
clipmove(p->pos, &p->cursector, p->vel.X, p->vel.Y, 164, (4 << 8), ii, CLIPMASK0, clip);
|
||||
|
||||
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
|
||||
p->player_add_int_z(32 << 8);
|
||||
p->pos.Z += 32;
|
||||
|
||||
if (clip.type != kHitNone)
|
||||
checkplayerhurt_d(p, clip);
|
||||
|
|
|
@ -3803,7 +3803,7 @@ HORIZONLY:
|
|||
clipmove(p->pos, &p->cursector, p->vel.X, p->vel.Y, 164, (4 << 8), i, CLIPMASK0, clip);
|
||||
|
||||
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
|
||||
p->player_add_int_z(32 << 8);
|
||||
p->pos.Z += 32;
|
||||
|
||||
if (clip.type != kHitNone)
|
||||
checkplayerhurt_r(p, clip);
|
||||
|
@ -4046,7 +4046,8 @@ void OnMotorcycle(struct player_struct *p, DDukeActor* motosprite)
|
|||
{
|
||||
if (motosprite)
|
||||
{
|
||||
p->getxyfromactor(motosprite);
|
||||
p->pos.X = motosprite->spr.pos.X;
|
||||
p->pos.Y = motosprite->spr.pos.Y;
|
||||
p->angle.ang = buildang(motosprite->spr.ang);
|
||||
p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->saved_ammo;
|
||||
deletesprite(motosprite);
|
||||
|
@ -4125,7 +4126,8 @@ void OnBoat(struct player_struct *p, DDukeActor* boat)
|
|||
{
|
||||
if (boat)
|
||||
{
|
||||
p->getxyfromactor(boat);
|
||||
p->pos.X = boat->spr.pos.X;
|
||||
p->pos.Y = boat->spr.pos.Y;
|
||||
p->angle.ang = buildang(boat->spr.ang);
|
||||
p->ammo_amount[BOAT_WEAPON] = boat->saved_ammo;
|
||||
deletesprite(boat);
|
||||
|
|
|
@ -439,7 +439,7 @@ void operateweapon_ww(int snum, ESyncBits actions)
|
|||
if (aplWeaponFlags(p->curr_weapon, snum) & WEAPON_FLAG_STANDSTILL
|
||||
&& p->kickback_pic < (aplWeaponFireDelay(p->curr_weapon, snum) + 1))
|
||||
{
|
||||
p->player_set_int_z(p->player_int_opos().Z);
|
||||
p->pos.Z = p->opos.Z;
|
||||
p->vel.Z = 0;
|
||||
}
|
||||
if (p->kickback_pic == aplWeaponSound2Time(p->curr_weapon, snum))
|
||||
|
|
|
@ -372,12 +372,6 @@ struct player_struct
|
|||
opos.Y = pos.Y;
|
||||
}
|
||||
|
||||
void restorexy()
|
||||
{
|
||||
pos.X = opos.X;
|
||||
pos.Y = opos.Y;
|
||||
}
|
||||
|
||||
void backupz()
|
||||
{
|
||||
opos.Z = pos.Z;
|
||||
|
|
Loading…
Reference in a new issue