- moved th player resurrection code into a player_t method.
This commit is contained in:
parent
71fe4a83c9
commit
bdf761e457
5 changed files with 47 additions and 29 deletions
|
|
@ -339,35 +339,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
|||
}
|
||||
else
|
||||
{
|
||||
player->mo->Revive();
|
||||
player->playerstate = PST_LIVE;
|
||||
player->health = player->mo->health = player->mo->GetDefault()->health;
|
||||
player->viewheight = ((APlayerPawn *)player->mo->GetDefault())->ViewHeight;
|
||||
player->mo->renderflags &= ~RF_INVISIBLE;
|
||||
player->mo->Height = player->mo->GetDefault()->Height;
|
||||
player->mo->radius = player->mo->GetDefault()->radius;
|
||||
player->mo->special1 = 0; // required for the Hexen fighter's fist attack.
|
||||
// This gets set by AActor::Die as flag for the wimpy death and must be reset here.
|
||||
player->mo->SetState (player->mo->SpawnState);
|
||||
if (!(player->mo->flags2 & MF2_DONTTRANSLATE))
|
||||
{
|
||||
player->mo->Translation = TRANSLATION(TRANSLATION_Players, uint8_t(player-players));
|
||||
}
|
||||
if (player->ReadyWeapon != nullptr)
|
||||
{
|
||||
P_SetPsprite(player, PSP_WEAPON, player->ReadyWeapon->GetUpState());
|
||||
}
|
||||
|
||||
if (player->morphTics)
|
||||
{
|
||||
P_UndoPlayerMorph(player, player);
|
||||
}
|
||||
|
||||
// player is now alive.
|
||||
// fire E_PlayerRespawned and start the ACS SCRIPT_Respawn.
|
||||
E_PlayerRespawned(int(player - players));
|
||||
//
|
||||
FBehavior::StaticStartTypedScripts(SCRIPT_Respawn, player->mo, true);
|
||||
player->Resurrect();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue