- Fixed: FMOD calls for setting the water reverb must check the return code

for errors.
- Fixed: Hexen's dual attack weapons must check distance to targets in 3D,
  not 2D.


SVN r1336 (trunk)
This commit is contained in:
Christoph Oelckers 2008-12-30 23:27:27 +00:00
parent aeaf94c1c4
commit 987c878a9a
7 changed files with 70 additions and 30 deletions

View file

@ -1,4 +1,8 @@
December 30, 2008 (Changes by Graf Zahl)
- Fixed: FMOD calls for setting the water reverb must check the return code
for errors.
- Fixed: Hexen's dual attack weapons must check distance to targets in 3D,
not 2D.
- Made several DECORATE errors which do not involve parsing non-fatal.
- Added a static error counter to FScriptPosition class.
- Changed initialization of actor class type properties: fuglyname is gone as

View file

@ -66,7 +66,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
for (i = 0; i < 3; i++)
{
angle = pmo->angle+i*(ANG45/16);
slope = P_AimLineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), &linetarget);
slope = P_AimLineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), &linetarget, 0, false, true);
if (linetarget)
{
P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, PClass::FindClass ("CStaffPuff"));
@ -90,7 +90,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
break;
}
angle = pmo->angle-i*(ANG45/16);
slope = P_AimLineAttack (player->mo, angle, fixed_t(1.5*MELEERANGE), &linetarget);
slope = P_AimLineAttack (player->mo, angle, fixed_t(1.5*MELEERANGE), &linetarget, 0, false, true);
if (linetarget)
{
P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, PClass::FindClass ("CStaffPuff"));

View file

@ -46,7 +46,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
for (i = 0; i < 16; i++)
{
angle = pmo->angle + i*(ANG45/32);
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE, &linetarget);
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE, &linetarget, 0, false, true);
if (linetarget)
{
P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true);
@ -59,7 +59,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
goto hammerdone;
}
angle = pmo->angle-i*(ANG45/32);
slope = P_AimLineAttack(pmo, angle, HAMMER_RANGE, &linetarget);
slope = P_AimLineAttack(pmo, angle, HAMMER_RANGE, &linetarget, 0, false, true);
if(linetarget)
{
P_LineAttack(pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true);
@ -74,7 +74,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
}
// didn't find any targets in meleerange, so set to throw out a hammer
angle = pmo->angle;
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE, &linetarget);
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE, &linetarget, 0, false, true);
if (P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"), true) != NULL)
{
pmo->special1 = false;

View file

@ -77,7 +77,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
for (i = 0; i < 16; i++)
{
angle = self->angle+i*(ANG45/16);
slope = P_AimLineAttack (self, angle, MELEERANGE, &linetarget);
slope = P_AimLineAttack (self, angle, MELEERANGE, &linetarget, 0, false, true);
if (linetarget)
{
P_DamageMobj (linetarget, self, self, damage, NAME_Ice);

View file

@ -380,7 +380,7 @@ void P_FindFloorCeiling (AActor *actor, bool onlymidtex = false);
bool P_ChangeSector (sector_t* sector, int crunch, int amt, int floorOrCeil, bool isreset);
fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **pLineTarget = NULL, fixed_t vrange=0, bool forcenosmart=false);
fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **pLineTarget = NULL, fixed_t vrange=0, bool forcenosmart=false, bool check3d = false);
AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, const PClass *pufftype, bool ismelee = false);
AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, FName pufftype, bool ismelee = false);
void P_TraceBleed (int damage, fixed_t x, fixed_t y, fixed_t z, AActor *target, angle_t angle, int pitch);

View file

@ -2359,6 +2359,7 @@ struct aim_t
AActor * thing_friend, * thing_other;
angle_t pitch_friend, pitch_other;
bool notsmart;
bool check3d;
void AimTraverse (fixed_t startx, fixed_t starty, fixed_t endx, fixed_t endy);
@ -2457,6 +2458,23 @@ void aim_t::AimTraverse (fixed_t startx, fixed_t starty, fixed_t endx, fixed_t e
thingpitch = thingtoppitch/2 + thingbottompitch/2;
if (check3d)
{
// We need to do a 3D distance check here because this is nearly always used in
// combination with P_LineAttack. P_LineAttack uses 3D distance but FPathTraverse
// only 2D. This causes some problems with Hexen's weapons that use different
// attack modes based on distance to target
fixed_t cosine = finecosine[thingpitch >> ANGLETOFINESHIFT];
if (cosine != 0)
{
fixed_t d3 = FixedDiv( FixedMul( P_AproxDistance(it.Trace().dx, it.Trace().dy), in->frac), cosine);
if (d3 > attackrange)
{
return;
}
}
}
if (sv_smartaim && !notsmart)
{
// try to be a little smarter about what to aim at!
@ -2500,7 +2518,7 @@ void aim_t::AimTraverse (fixed_t startx, fixed_t starty, fixed_t endx, fixed_t e
// P_AimLineAttack
//
//============================================================================
fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **pLineTarget, fixed_t vrange, bool forcenosmart)
fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **pLineTarget, fixed_t vrange, bool forcenosmart, bool check3d)
{
fixed_t x2;
fixed_t y2;
@ -2508,6 +2526,7 @@ fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, AActor **p
angle >>= ANGLETOFINESHIFT;
aim.shootthing = t1;
aim.check3d = check3d;
x2 = t1->x + (distance>>FRACBITS)*finecosine[angle];
y2 = t1->y + (distance>>FRACBITS)*finesine[angle];

View file

@ -903,8 +903,11 @@ bool FMODSoundRenderer::Init()
FMOD::DSP *sfx_head, *pausable_head;
result = SfxGroup->getDSPHead(&sfx_head);
if (result == FMOD_OK)
{
result = sfx_head->getInput(0, &pausable_head, &SfxConnection);
if (result == FMOD_OK)
{
result = WaterLP->addInput(pausable_head, NULL);
WaterLP->setActive(false);
WaterLP->setParameter(FMOD_DSP_LOWPASS_CUTOFF, snd_waterlp);
@ -913,18 +916,32 @@ bool FMODSoundRenderer::Init()
{
FMOD::DSPConnection *dry;
result = WaterReverb->addInput(pausable_head, &dry);
if (result == FMOD_OK)
{
result = dry->setMix(0.1f);
if (result == FMOD_OK)
{
result = WaterReverb->addInput(WaterLP, NULL);
if (result == FMOD_OK)
{
result = sfx_head->addInput(WaterReverb, NULL);
if (result == FMOD_OK)
{
WaterReverb->setParameter(FMOD_DSP_REVERB_ROOMSIZE, 0.001f);
WaterReverb->setParameter(FMOD_DSP_REVERB_DAMP, 0.2f);
WaterReverb->setActive(false);
}
}
}
}
}
else
{
result = sfx_head->addInput(WaterLP, NULL);
}
}
}
}
LastWaterLP = snd_waterlp;
// Find the FMOD Channel Group Target Unit. To completely eliminate sound