- Updated scripting branch to latest version in trunk.

SVN r4337 (scripting)
This commit is contained in:
Randy Heit 2013-06-07 03:31:30 +00:00
commit 459ad5abff
282 changed files with 15968 additions and 3535 deletions

View file

@ -550,6 +550,15 @@ bool P_Move (AActor *actor)
{
actor->z = savedz;
}
else
{ // The monster just hit the floor, so trigger any actions.
if (actor->floorsector->SecActTarget != NULL &&
actor->floorz == actor->floorsector->floorplane.ZatPoint(actor->x, actor->y))
{
actor->floorsector->SecActTarget->TriggerAction(actor, SECSPAC_HitFloor);
}
P_CheckFor3DFloorHit(actor);
}
}
}
@ -1869,7 +1878,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
{
if (!(flags & LOF_NOSOUNDCHECK))
{
targ = (self->flags & MF_NOSECTOR)? self->Sector->SoundTarget : self->LastHeard;
targ = (i_compatflags & COMPATF_SOUNDTARGET || self->flags & MF_NOSECTOR)?
self->Sector->SoundTarget : self->LastHeard;
if (targ != NULL)
{
// [RH] If the soundtarget is dead, don't chase it
@ -2801,9 +2811,18 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch)
{
// [DH] Don't need to do proper fixed->double conversion, since the
// result is only used in a ratio.
double dist_x = self->target->x - self->x;
double dist_y = self->target->y - self->y;
double dist_z = self->target->z - self->z;
double dist_x = other->x - self->x;
double dist_y = other->y - self->y;
// Positioning ala missile spawning, 32 units above foot level
fixed_t source_z = self->z + 32*FRACUNIT + self->GetBobOffset();
fixed_t target_z = other->z + 32*FRACUNIT + other->GetBobOffset();
// If the target z is above the target's head, reposition to the middle of
// its body.
if (target_z >= other->z + other->height)
{
target_z = other->z + other->height / 2;
}
double dist_z = target_z - source_z;
double dist = sqrt(dist_x*dist_x + dist_y*dist_y + dist_z*dist_z);
int other_pitch = (int)rad2bam(asin(dist_z / dist));
@ -3043,17 +3062,22 @@ void ModifyDropAmount(AInventory *inv, int dropamount)
int amount = static_cast<PClassAmmo *>(inv->GetClass())->DropAmount;
if (amount <= 0)
{
amount = FixedMul(inv->Amount, dropammofactor);
amount = MAX(1, FixedMul(inv->Amount, dropammofactor));
}
inv->Amount = amount;
inv->ItemFlags |= flagmask;
}
else if (inv->IsKindOf (RUNTIME_CLASS(AWeaponGiver)))
{
static_cast<AWeaponGiver *>(inv)->DropAmmoFactor = dropammofactor;
inv->ItemFlags |= flagmask;
}
else if (inv->IsKindOf (RUNTIME_CLASS(AWeapon)))
{
// The same goes for ammo from a weapon.
static_cast<AWeapon *>(inv)->AmmoGive1 = FixedMul(static_cast<AWeapon *>(inv)->AmmoGive1, dropammofactor);
static_cast<AWeapon *>(inv)->AmmoGive2 = FixedMul(static_cast<AWeapon *>(inv)->AmmoGive2, dropammofactor);
inv->ItemFlags|=flagmask;
inv->ItemFlags |= flagmask;
}
else if (inv->IsKindOf (RUNTIME_CLASS(ADehackedPickup)))
{
@ -3109,6 +3133,8 @@ AInventory *P_DropItem (AActor *source, PClassActor *type, int dropamount, int c
ModifyDropAmount(inv, dropamount);
if (inv->SpecialDropAction (source))
{
// The special action indicates that the item should not spawn
inv->Destroy();
return NULL;
}
return inv;