mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- removed some redundant initializations from PClassActor constructor.
- Removed GibHealth function and integrated it into AActor::GetGibHealth. SVN r2245 (scripting)
This commit is contained in:
parent
61d75b7cae
commit
e553f9a34f
3 changed files with 4 additions and 11 deletions
|
@ -176,8 +176,6 @@ PClassActor::PClassActor()
|
|||
DamageFactors = NULL;
|
||||
PainChances = NULL;
|
||||
|
||||
Obituary = Obituary;
|
||||
HitObituary = HitObituary;
|
||||
DeathHeight = -1;
|
||||
BurnHeight = -1;
|
||||
GibHealth = INT_MIN;
|
||||
|
|
|
@ -314,15 +314,10 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
|||
//
|
||||
EXTERN_CVAR (Int, fraglimit)
|
||||
|
||||
static int GibHealth(AActor *actor)
|
||||
{
|
||||
return -abs(actor->GetGibHealth());
|
||||
}
|
||||
|
||||
void AActor::Die (AActor *source, AActor *inflictor)
|
||||
{
|
||||
// Handle possible unmorph on death
|
||||
bool wasgibbed = (health < GibHealth(this));
|
||||
bool wasgibbed = (health < GetGibHealth());
|
||||
|
||||
AActor *realthis = NULL;
|
||||
int realstyle = 0;
|
||||
|
@ -333,7 +328,7 @@ void AActor::Die (AActor *source, AActor *inflictor)
|
|||
{
|
||||
if (wasgibbed)
|
||||
{
|
||||
int realgibhealth = GibHealth(realthis);
|
||||
int realgibhealth = realthis->GetGibHealth();
|
||||
if (realthis->health >= realgibhealth)
|
||||
{
|
||||
realthis->health = realgibhealth -1; // if morphed was gibbed, so must original be (where allowed)
|
||||
|
@ -661,7 +656,7 @@ void AActor::Die (AActor *source, AActor *inflictor)
|
|||
{
|
||||
int flags4 = inflictor == NULL ? 0 : inflictor->flags4;
|
||||
|
||||
int gibhealth = GibHealth(this);
|
||||
int gibhealth = GetGibHealth();
|
||||
|
||||
// Don't pass on a damage type this actor cannot handle.
|
||||
// (most importantly, prevent barrels from passing on ice damage.)
|
||||
|
|
|
@ -5561,7 +5561,7 @@ int AActor::GetGibHealth() const
|
|||
|
||||
if (gibhealth != INT_MIN)
|
||||
{
|
||||
return gibhealth;
|
||||
return -abs(gibhealth);
|
||||
}
|
||||
else if (gameinfo.gametype & GAME_DoomChex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue