- Fixed: A_SorcOffense2 depended on args being bytes and overflowing.

- Fixed: Even though P_DamageMobj checked an attack's originator
  for MF2_NODMGTHRUST the same check was missing from P_RadiusAttack.
- Fixed: A_MinotaurRoam should not assume without check that it was
  called by a MinotaurFriend.
- Fixed: The Minotaur declared A_MntrFloorFire which it did not use.
- Fixed: All Spawnspot functions did not check for a spot tid of 0 as
  the script's activator.
- Fixed: Friendly monsters ignored team association of their owning
  players.


SVN r1770 (trunk)
This commit is contained in:
Christoph Oelckers 2009-08-12 18:57:31 +00:00
parent a5ec361715
commit 385350efae
9 changed files with 83 additions and 48 deletions

View File

@ -1,4 +1,16 @@
August 11, 2009 (Changes by Graf Zahl)
August 12, 2009 (Changes by Graf Zahl)
- Fixed: A_SorcOffense2 depended on args being bytes and overflowing.
- Fixed: Even though P_DamageMobj checked an attack's originator
for MF2_NODMGTHRUST the same check was missing from P_RadiusAttack.
- Fixed: A_MinotaurRoam should not assume without check that it was
called by a MinotaurFriend.
- Fixed: The Minotaur declared A_MntrFloorFire which it did not use.
- Fixed: All Spawnspot functions did not check for a spot tid of 0 as
the script's activator.
- Fixed: Friendly monsters ignored team association of their owning
players.
August 11, 2009 (Changes by Graf Zahl)
- Fixed: The pause sprite was not centered correctly when it was a scaled
graphic.
@ -98,7 +110,7 @@ August 2, 2009 (Changes by Graf Zahl)
Misc1 variable were needed.
August 1, 2009
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
- Moved the target->velz assignment to the end of A_VileAttack to remove the
influence of vertical thrust from the radius attack, since ZDoom does
explosions in three dimensions, but Doom only did it in two.
- Fixed: The last three parameters to A_VileAttack had their references off

View File

@ -657,7 +657,7 @@ void A_SorcOffense2(AActor *actor)
}
index = actor->args[4] << 5;
actor->args[4] += 15;
actor->args[4] = (actor->args[4] + 15) & 255;
delta = (finesine[index])*SORCFX4_SPREAD_ANGLE;
delta = (delta>>FRACBITS)*ANGLE_1;
ang1 = actor->angle + delta;

View File

@ -464,34 +464,37 @@ void P_MinotaurSlam (AActor *source, AActor *target)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
{
AMinotaurFriend *self1 = static_cast<AMinotaurFriend *> (self);
// In case pain caused him to skip his fade in.
self1->RenderStyle = STYLE_Normal;
self->RenderStyle = STYLE_Normal;
if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS)
if (self->IsKindOf(RUNTIME_CLASS(AMinotaurFriend)))
{
P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None);
return;
AMinotaurFriend *self1 = static_cast<AMinotaurFriend *> (self);
if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS)
{
P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None);
return;
}
}
if (pr_minotaurroam() < 30)
CALL_ACTION(A_MinotaurLook, self1); // adjust to closest target
CALL_ACTION(A_MinotaurLook, self); // adjust to closest target
if (pr_minotaurroam() < 6)
{
//Choose new direction
self1->movedir = pr_minotaurroam() % 8;
FaceMovementDirection (self1);
self->movedir = pr_minotaurroam() % 8;
FaceMovementDirection (self);
}
if (!P_Move(self1))
if (!P_Move(self))
{
// Turn
if (pr_minotaurroam() & 1)
self1->movedir = (++self1->movedir)%8;
self->movedir = (++self->movedir)%8;
else
self1->movedir = (self1->movedir+7)%8;
FaceMovementDirection (self1);
self->movedir = (self->movedir+7)%8;
FaceMovementDirection (self);
}
}

View File

@ -72,8 +72,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
}
}
players[0].mo->GiveInventoryType (QuestItemClasses[6]);
players[0].SetLogNumber (14);
players[i].mo->GiveInventoryType (QuestItemClasses[6]);
players[i].SetLogNumber (14);
S_StopSound (CHAN_VOICE);
S_Sound (CHAN_VOICE, "svox/voc14", 1, ATTN_NORM);
}

View File

@ -2276,26 +2276,42 @@ int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, i
int DLevelScript::DoSpawnSpot (int type, int spot, int tid, int angle, bool force)
{
FActorIterator iterator (spot);
AActor *aspot;
int spawned = 0;
while ( (aspot = iterator.Next ()) )
if (spot != 0)
{
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, angle, force);
FActorIterator iterator (spot);
AActor *aspot;
while ( (aspot = iterator.Next ()) )
{
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, angle, force);
}
}
else if (activator != NULL)
{
spawned += DoSpawn (type, activator->x, activator->y, activator->z, tid, angle, force);
}
return spawned;
}
int DLevelScript::DoSpawnSpotFacing (int type, int spot, int tid, bool force)
{
FActorIterator iterator (spot);
AActor *aspot;
int spawned = 0;
while ( (aspot = iterator.Next ()) )
if (spot != 0)
{
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, aspot->angle >> 24, force);
FActorIterator iterator (spot);
AActor *aspot;
while ( (aspot = iterator.Next ()) )
{
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, aspot->angle >> 24, force);
}
}
else if (activator != NULL)
{
spawned += DoSpawn (type, activator->x, activator->y, activator->z, tid, activator->angle >> 24, force);
}
return spawned;
}

View File

@ -713,8 +713,8 @@ protected:
static void SetLineTexture (int lineid, int side, int position, int name);
static void ReplaceTextures (int fromname, int toname, int flags);
static int DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle, bool force);
static int DoSpawnSpot (int type, int spot, int tid, int angle, bool forced);
static int DoSpawnSpotFacing (int type, int spot, int tid, bool forced);
int DoSpawnSpot (int type, int spot, int tid, int angle, bool forced);
int DoSpawnSpotFacing (int type, int spot, int tid, bool forced);
int DoClassifyActor (int tid);
int CallFunction(int argCount, int funcIndex, SDWORD *args);

View File

@ -4064,25 +4064,28 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
if (!bombdodamage || !(bombspot->flags2 & MF2_NODMGTHRUST))
{
thrust = points * 0.5f / (float)thing->Mass;
if (bombsource == thing)
if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST))
{
thrust *= selfthrustscale;
thrust = points * 0.5f / (float)thing->Mass;
if (bombsource == thing)
{
thrust *= selfthrustscale;
}
velz = (float)(thing->z + (thing->height>>1) - bombspot->z) * thrust;
if (bombsource != thing)
{
velz *= 0.5f;
}
else
{
velz *= 0.8f;
}
angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT;
thing->velx += fixed_t (finecosine[ang] * thrust);
thing->vely += fixed_t (finesine[ang] * thrust);
if (bombdodamage)
thing->velz += (fixed_t)velz; // this really doesn't work well
}
velz = (float)(thing->z + (thing->height>>1) - bombspot->z) * thrust;
if (bombsource != thing)
{
velz *= 0.5f;
}
else
{
velz *= 0.8f;
}
angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT;
thing->velx += fixed_t (finecosine[ang] * thrust);
thing->vely += fixed_t (finesine[ang] * thrust);
if (bombdodamage)
thing->velz += (fixed_t)velz; // this really doesn't work well
}
}
}

View File

@ -5160,7 +5160,8 @@ bool AActor::IsFriend (AActor *other)
return !deathmatch ||
FriendPlayer == other->FriendPlayer ||
FriendPlayer == 0 ||
other->FriendPlayer == 0;
other->FriendPlayer == 0 ||
players[FriendPlayer-1].mo->IsTeammate(players[other->FriendPlayer-1].mo);
}
return false;
}
@ -5184,7 +5185,8 @@ bool AActor::IsHostile (AActor *other)
return deathmatch &&
FriendPlayer != other->FriendPlayer &&
FriendPlayer !=0 &&
other->FriendPlayer != 0;
other->FriendPlayer != 0 &&
!players[FriendPlayer-1].mo->IsTeammate(players[other->FriendPlayer-1].mo);
}
return true;
}

View File

@ -29,7 +29,6 @@ ACTOR Minotaur 9 native
action native A_MinotaurAtk2();
action native A_MinotaurAtk3();
action native A_MinotaurCharge();
action native A_MntrFloorFire();
action native A_MinotaurLook();
action native A_MinotaurRoam();
action native A_MinotaurChase();