This completes player_r.cpp

This commit is contained in:
Christoph Oelckers 2020-10-27 06:50:06 +01:00
parent 34d0219d06
commit 12ef8c4543
3 changed files with 11 additions and 11 deletions

View file

@ -173,7 +173,7 @@ const char* GameInterface::GenericCheat(int player, int cheat)
return cheatMonsters();
case CHT_BIKE:
OnMotorcycle(&ps[player], 0);
OnMotorcycle(&ps[player], nullptr);
ps[player].ammo_amount[MOTORCYCLE_WEAPON] = max_ammo_amount[MOTORCYCLE_WEAPON];
return quoteMgr.GetQuote(QUOTE_ON_BIKE);

View file

@ -208,7 +208,7 @@ void cacheit_d();
void cacheit_r();
void FTA(int q, struct player_struct* p);
void OnMotorcycle(player_struct *pl, int snum);
void OnMotorcycle(player_struct *pl, DDukeActor* snum);
void OffMotorcycle(player_struct *pl);
void OnBoat(player_struct *pl, DDukeActor* snum);
void OffBoat(player_struct *pl);

View file

@ -4030,9 +4030,9 @@ HORIZONLY:
if (psectlotag < 3)
{
psect = s->sectnum;
if (ud.clipping == 0 && sector[psect].lotag == 31)
if (ud.clipping == 0 && sector[psect].lotag == ST_31_TWO_WAY_TRAIN)
{
if (sprite[sector[psect].hitag].xvel && hittype[sector[psect].hitag].temp_data[0] == 0)
if (sprite[sector[psect].hitag].xvel && hittype[sector[psect].hitag].temp_data[0] == 0) // hijack
{
quickkill(p);
return;
@ -4177,16 +4177,16 @@ void processmove_r(int snum, ESyncBits actions, int psect, int fz, int cz, int s
//
//---------------------------------------------------------------------------
void OnMotorcycle(struct player_struct *p, int motosprite)
void OnMotorcycle(struct player_struct *p, DDukeActor* motosprite)
{
if (!p->OnMotorcycle && !(sector[p->cursectnum].lotag == 2))
{
if (motosprite)
{
p->posx = sprite[motosprite].x;
p->posy = sprite[motosprite].y;
p->angle.ang = buildang(sprite[motosprite].ang);
p->ammo_amount[MOTORCYCLE_WEAPON] = sprite[motosprite].owner;
p->posx = motosprite->s.x;
p->posy = motosprite->s.y;
p->angle.ang = buildang(motosprite->s.ang);
p->ammo_amount[MOTORCYCLE_WEAPON] = motosprite->s.owner; // hijack
deletesprite(motosprite);
}
p->over_shoulder_on = 0;
@ -4198,8 +4198,8 @@ void OnMotorcycle(struct player_struct *p, int motosprite)
p->posyv = 0;
p->horizon.horiz = q16horiz(0);
}
if (!S_CheckActorSoundPlaying(p->i,186))
S_PlayActorSound(186, p->i);
if (!S_CheckActorSoundPlaying(p->GetActor(),186))
S_PlayActorSound(186, p->GetActor());
}
//---------------------------------------------------------------------------