- fixed: armor factor application was done wrong.

- fixed: APROP_Invulnerable could only be set and unset but not checked.
- fixed: Two sided polyobjects applied thrust to sctors in a way that did not work.


SVN r2620 (trunk)
This commit is contained in:
Christoph Oelckers 2010-08-28 12:57:23 +00:00
parent 7baeeeaab5
commit 5647fed0cf
3 changed files with 25 additions and 8 deletions

View file

@ -211,16 +211,17 @@ void ABasicArmorPickup::Serialize (FArchive &arc)
AInventory *ABasicArmorPickup::CreateCopy (AActor *other)
{
ABasicArmorPickup *copy = static_cast<ABasicArmorPickup *> (Super::CreateCopy (other));
copy->SavePercent = SavePercent;
copy->SaveAmount = SaveAmount;
copy->MaxAbsorb = MaxAbsorb;
copy->MaxFullAbsorb = MaxFullAbsorb;
if (!(ItemFlags & IF_IGNORESKILL))
{
SaveAmount = FixedMul(SaveAmount, G_SkillProperty(SKILLP_ArmorFactor));
}
copy->SavePercent = SavePercent;
copy->SaveAmount = SaveAmount;
copy->MaxAbsorb = MaxAbsorb;
copy->MaxFullAbsorb = MaxFullAbsorb;
return copy;
}
@ -291,6 +292,12 @@ void ABasicArmorBonus::Serialize (FArchive &arc)
AInventory *ABasicArmorBonus::CreateCopy (AActor *other)
{
ABasicArmorBonus *copy = static_cast<ABasicArmorBonus *> (Super::CreateCopy (other));
if (!(ItemFlags & IF_IGNORESKILL))
{
SaveAmount = FixedMul(SaveAmount, G_SkillProperty(SKILLP_ArmorFactor));
}
copy->SavePercent = SavePercent;
copy->SaveAmount = SaveAmount;
copy->MaxSaveAmount = MaxSaveAmount;
@ -299,10 +306,6 @@ AInventory *ABasicArmorBonus::CreateCopy (AActor *other)
copy->MaxAbsorb = MaxAbsorb;
copy->MaxFullAbsorb = MaxFullAbsorb;
if (!(ItemFlags & IF_IGNORESKILL))
{
SaveAmount = FixedMul(SaveAmount, G_SkillProperty(SKILLP_ArmorFactor));
}
return copy;
}

View file

@ -2759,6 +2759,7 @@ int DLevelScript::GetActorProperty (int tid, int property)
// so pretends it's normal.
return STYLE_Normal;
case APROP_Gravity: return actor->gravity;
case APROP_Invulnerable:return !!(actor->flags2 & MF2_INVULNERABLE);
case APROP_Ambush: return !!(actor->flags & MF_AMBUSH);
case APROP_Dropped: return !!(actor->flags & MF_DROPPED);
case APROP_ChaseGoal: return !!(actor->flags5 & MF5_CHASEGOAL);
@ -2820,6 +2821,7 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value)
// Boolean values need to compare to a binary version of value
case APROP_Ambush:
case APROP_Invulnerable:
case APROP_Dropped:
case APROP_ChaseGoal:
case APROP_Frightened:

View file

@ -1245,6 +1245,7 @@ bool FPolyObj::CheckMobjBlocking (side_t *sd)
bool blocked;
ld = sd->linedef;
top = (ld->bbox[BOXTOP]-bmaporgy) >> MAPBLOCKSHIFT;
bottom = (ld->bbox[BOXBOTTOM]-bmaporgy) >> MAPBLOCKSHIFT;
left = (ld->bbox[BOXLEFT]-bmaporgx) >> MAPBLOCKSHIFT;
@ -1294,6 +1295,17 @@ bool FPolyObj::CheckMobjBlocking (side_t *sd)
{
continue;
}
// We have a two-sided linedef so we should only check one side
// so that the thrust from both sides doesn't cancel each other out.
// Best use the one facing the player and ignore the back side.
if (ld->sidedef[1] != NULL)
{
int side = P_PointOnLineSide(mobj->x, mobj->y, ld);
if (ld->sidedef[side] != sd)
{
continue;
}
}
ThrustMobj (mobj, sd);
blocked = true;
}