- Fixed: In the past, ZDoom worked like Doom and used integral values for

monster speeds. Now it uses fixed point so that an actor's speed property
  can always be considered is always fixed point. So DoSetActorProperty()
  should scale very slow speeds, just like dehacked's PatchThing() has done
  for some time now.


SVN r187 (trunk)
This commit is contained in:
Randy Heit 2006-06-14 03:57:58 +00:00
parent 37ab80b566
commit 2a0216cf6f
3 changed files with 75 additions and 16 deletions

View File

@ -1,3 +1,10 @@
June 13, 2006
- Fixed: In the past, ZDoom worked like Doom and used integral values for
monster speeds. Now it uses fixed point so that an actor's speed property
can always be considered is always fixed point. So DoSetActorProperty()
should scale very slow speeds, just like dehacked's PatchThing() has done
for some time now.
June 11, 2006 (Changes by Graf Zahl)
- Changed UpgradeStamina to use AInventory's Amount and MaxAmount to
control the amount of upgrade and the maximum that can be reached.

View File

@ -1045,7 +1045,7 @@ static int PatchThing (int thingy)
}
// If this thing's speed is really low (i.e. meant to be a monster),
// bump it up, because all speeds are fixed point now.
if (info->Speed < 256)
if (abs(info->Speed) < 256)
{
info->Speed <<= FRACBITS;
}

View File

@ -1988,21 +1988,73 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
actor->player->health = value;
}
break;
case APROP_Speed: actor->Speed = value; break;
case APROP_Damage: actor->damage = value; break;
case APROP_Alpha: actor->alpha = value; break;
case APROP_RenderStyle: actor->RenderStyle = value; break;
case APROP_Ambush: if (value) actor->flags |= MF_AMBUSH; else actor->flags &= ~MF_AMBUSH; break;
case APROP_Invulnerable:if (value) actor->flags2 |= MF2_INVULNERABLE; else actor->flags2 &= ~MF2_INVULNERABLE; break;
case APROP_JumpZ: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
static_cast<APlayerPawn *>(actor)->JumpZ = value; break; // [GRB]
case APROP_ChaseGoal: if (value) actor->flags5 |= MF5_CHASEGOAL; else actor->flags5 &= ~MF5_CHASEGOAL; break;
case APROP_Frightened: if (value) actor->flags4 |= MF4_FRIGHTENED; else actor->flags4 &= ~MF4_FRIGHTENED; break;
case APROP_SeeSound: actor->SeeSound = S_FindSound (FBehavior::StaticLookupString (value)); break;
case APROP_AttackSound: actor->AttackSound = S_FindSound (FBehavior::StaticLookupString (value)); break;
case APROP_PainSound: actor->PainSound = S_FindSound (FBehavior::StaticLookupString (value)); break;
case APROP_DeathSound: actor->DeathSound = S_FindSound (FBehavior::StaticLookupString (value)); break;
case APROP_ActiveSound: actor->ActiveSound = S_FindSound (FBehavior::StaticLookupString (value)); break;
case APROP_Speed:
if (abs(value) < 128)
{ // Backwards compatibility: Older ZDooms didn't use fixed point in A_Chase.
value <<= FRACBITS;
}
actor->Speed = value;
break;
case APROP_Damage:
actor->damage = value;
break;
case APROP_Alpha:
actor->alpha = value;
break;
case APROP_RenderStyle:
actor->RenderStyle = value;
break;
case APROP_Ambush:
if (value) actor->flags |= MF_AMBUSH; else actor->flags &= ~MF_AMBUSH;
break;
case APROP_Invulnerable:
if (value) actor->flags2 |= MF2_INVULNERABLE; else actor->flags2 &= ~MF2_INVULNERABLE;
break;
case APROP_JumpZ:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
static_cast<APlayerPawn *>(actor)->JumpZ = value;
break; // [GRB]
case APROP_ChaseGoal:
if (value)
actor->flags5 |= MF5_CHASEGOAL;
else
actor->flags5 &= ~MF5_CHASEGOAL;
break;
case APROP_Frightened:
if (value)
actor->flags4 |= MF4_FRIGHTENED;
else
actor->flags4 &= ~MF4_FRIGHTENED;
break;
case APROP_SeeSound:
actor->SeeSound = S_FindSound (FBehavior::StaticLookupString (value));
break;
case APROP_AttackSound:
actor->AttackSound = S_FindSound (FBehavior::StaticLookupString (value));
break;
case APROP_PainSound:
actor->PainSound = S_FindSound (FBehavior::StaticLookupString (value));
break;
case APROP_DeathSound:
actor->DeathSound = S_FindSound (FBehavior::StaticLookupString (value));
break;
case APROP_ActiveSound:
actor->ActiveSound = S_FindSound (FBehavior::StaticLookupString (value));
break;
}
}