- Fixed: "give health" without an amount would set your health to IDDQD health

instead of the player class's maximum.
- Fixed: A_CStaffCheck() assumed the player's max health was 100 instead
  of getting checking for the true maximum.


SVN r1876 (trunk)
This commit is contained in:
Randy Heit 2009-09-25 03:07:20 +00:00
parent 2ad438d696
commit d816747c7e
4 changed files with 19 additions and 12 deletions

View file

@ -1,4 +1,8 @@
September 24, 2009 September 24, 2009
- Fixed: "give health" without an amount would set your health to IDDQD health
instead of the player class's maximum.
- Fixed: A_CStaffCheck() assumed the player's max health was 100 instead
of getting checking for the true maximum.
- Changed P_XYMovement() to not call P_SlideMove() if the act of being - Changed P_XYMovement() to not call P_SlideMove() if the act of being
blocked changed the actor's velocity. I'm not entirely happy with this, blocked changed the actor's velocity. I'm not entirely happy with this,
but it gets push-activated force fields to work. but it gets push-activated force fields to work.

View file

@ -46,9 +46,9 @@ int ACStaffMissile::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck) DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
{ {
AActor *pmo; APlayerPawn *pmo;
int damage; int damage;
int newLife; int newLife, max;
angle_t angle; angle_t angle;
int slope; int slope;
int i; int i;
@ -63,6 +63,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
pmo = player->mo; pmo = player->mo;
damage = 20+(pr_staffcheck()&15); damage = 20+(pr_staffcheck()&15);
max = pmo->GetMaxHealth();
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
angle = pmo->angle+i*(ANG45/16); angle = pmo->angle+i*(ANG45/16);
@ -76,7 +77,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
&& (!(linetarget->flags2&(MF2_DORMANT+MF2_INVULNERABLE)))) && (!(linetarget->flags2&(MF2_DORMANT+MF2_INVULNERABLE))))
{ {
newLife = player->health+(damage>>3); newLife = player->health+(damage>>3);
newLife = newLife > 100 ? 100 : newLife; newLife = newLife > max ? max : newLife;
if (newLife > player->health) if (newLife > player->health)
{ {
pmo->health = player->health = newLife; pmo->health = player->health = newLife;
@ -99,7 +100,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
if ((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0)) || linetarget->flags3&MF3_ISMONSTER) if ((linetarget->player && (!linetarget->IsTeammate (pmo) || level.teamdamage != 0)) || linetarget->flags3&MF3_ISMONSTER)
{ {
newLife = player->health+(damage>>4); newLife = player->health+(damage>>4);
newLife = newLife > 100 ? 100 : newLife; newLife = newLife > max ? max : newLife;
pmo->health = player->health = newLife; pmo->health = player->health = newLife;
P_SetPsprite (player, ps_weapon, weapon->FindState ("Drain")); P_SetPsprite (player, ps_weapon, weapon->FindState ("Drain"));
} }

View file

@ -52,7 +52,7 @@
void cht_DoCheat (player_t *player, int cheat) void cht_DoCheat (player_t *player, int cheat)
{ {
static const PClass *BeholdPowers[9] = static const PClass * const BeholdPowers[9] =
{ {
RUNTIME_CLASS(APowerInvulnerable), RUNTIME_CLASS(APowerInvulnerable),
RUNTIME_CLASS(APowerStrength), RUNTIME_CLASS(APowerStrength),
@ -631,11 +631,15 @@ void cht_Give (player_t *player, const char *name, int amount)
} }
else else
{ {
if (player->mo) if (player->mo != NULL)
player->mo->health = deh.GodHealth; {
player->health = player->mo->health = player->mo->GetMaxHealth();
}
else
{
player->health = deh.GodHealth; player->health = deh.GodHealth;
} }
}
if (!giveall) if (!giveall)
return; return;

View file

@ -2796,9 +2796,7 @@ FUNC(LS_ForceField)
if (it != NULL) if (it != NULL)
{ {
P_DamageMobj (it, NULL, NULL, 16, NAME_None); P_DamageMobj (it, NULL, NULL, 16, NAME_None);
angle_t an = (it->angle + ANGLE_180) >> ANGLETOFINESHIFT; P_ThrustMobj (it, it->angle + ANGLE_180, 0x7D000);
it->velx = FixedMul(0x7D000, finecosine[an]);
it->vely = FixedMul(0x7D000, finesine[an]);
} }
return true; return true;
} }