mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-13 07:57:51 +00:00
- fixed: CHANGELEVEL_RESETINVENTORY may not change the player's health.
APlayerPawn::GiveDefaultInventory altered the player_t's health value which was ok as long as this function was only called from G_PlayerReborn. For all other cases this initialization was wrong and G_PlayerReborn should do this itself.
This commit is contained in:
parent
cfe97b0f0f
commit
fc40e9723a
3 changed files with 3 additions and 4 deletions
|
@ -1363,6 +1363,7 @@ void G_PlayerReborn (int player)
|
||||||
::new(p) player_t;
|
::new(p) player_t;
|
||||||
|
|
||||||
memcpy (p->frags, frags, sizeof(p->frags));
|
memcpy (p->frags, frags, sizeof(p->frags));
|
||||||
|
p->health = actor->health;
|
||||||
p->fragcount = fragcount;
|
p->fragcount = fragcount;
|
||||||
p->killcount = killcount;
|
p->killcount = killcount;
|
||||||
p->itemcount = itemcount;
|
p->itemcount = itemcount;
|
||||||
|
@ -1381,6 +1382,8 @@ void G_PlayerReborn (int player)
|
||||||
|
|
||||||
if (gamestate != GS_TITLELEVEL)
|
if (gamestate != GS_TITLELEVEL)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// [GRB] Give inventory specified in DECORATE
|
||||||
actor->GiveDefaultInventory ();
|
actor->GiveDefaultInventory ();
|
||||||
p->ReadyWeapon = p->PendingWeapon;
|
p->ReadyWeapon = p->PendingWeapon;
|
||||||
}
|
}
|
||||||
|
|
|
@ -340,7 +340,6 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
player->mo->Translation = TRANSLATION(TRANSLATION_Players, BYTE(player-players));
|
player->mo->Translation = TRANSLATION(TRANSLATION_Players, BYTE(player-players));
|
||||||
}
|
}
|
||||||
player->mo->DamageType = NAME_None;
|
player->mo->DamageType = NAME_None;
|
||||||
// player->mo->GiveDefaultInventory();
|
|
||||||
if (player->ReadyWeapon != NULL)
|
if (player->ReadyWeapon != NULL)
|
||||||
{
|
{
|
||||||
P_SetPsprite(player, ps_weapon, player->ReadyWeapon->GetUpState());
|
P_SetPsprite(player, ps_weapon, player->ReadyWeapon->GetUpState());
|
||||||
|
|
|
@ -1203,9 +1203,6 @@ void APlayerPawn::GiveDefaultInventory ()
|
||||||
{
|
{
|
||||||
if (player == NULL) return;
|
if (player == NULL) return;
|
||||||
|
|
||||||
// [GRB] Give inventory specified in DECORATE
|
|
||||||
player->health = GetDefault ()->health;
|
|
||||||
|
|
||||||
// HexenArmor must always be the first item in the inventory because
|
// HexenArmor must always be the first item in the inventory because
|
||||||
// it provides player class based protection that should not affect
|
// it provides player class based protection that should not affect
|
||||||
// any other protection item.
|
// any other protection item.
|
||||||
|
|
Loading…
Reference in a new issue