Skip to content

Commit

Permalink
- fixed: IceGuyFX2 set its owner too late.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Nov 25, 2020
1 parent 9925cc3 commit e19b1b2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 27 deletions.
2 changes: 0 additions & 2 deletions src/playsim/p_local.h
Expand Up @@ -117,8 +117,6 @@ AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassAct
AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL);
AActor *P_SpawnMissileZ(AActor* source, double z, AActor* dest, PClassActor *type);
AActor *P_SpawnMissileXYZ(DVector3 pos, AActor *source, AActor *dest, PClassActor *type, bool checkspawn = true, AActor *owner = NULL);
AActor *P_SpawnMissileAngle(AActor *source, PClassActor *type, DAngle angle, double vz);
AActor *P_SpawnMissileAngleZ(AActor *source, double z, PClassActor *type, DAngle angle, double vz);
AActor *P_SpawnMissileAngleZSpeed(AActor *source, double z, PClassActor *type, DAngle angle, double vz, double speed, AActor *owner = NULL, bool checkspawn = true);
AActor *P_SpawnMissileZAimed(AActor *source, double z, AActor *dest, PClassActor *type);

Expand Down
18 changes: 0 additions & 18 deletions src/playsim/p_mobj.cpp
Expand Up @@ -6705,24 +6705,6 @@ DEFINE_ACTION_FUNCTION(AActor, OldSpawnMissile)
//
//---------------------------------------------------------------------------

AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type, DAngle angle, double vz)
{
if (source == nullptr || type == nullptr)
{
return NULL;
}
return P_SpawnMissileAngleZSpeed (source, source->Z() + 32 + source->GetBobOffset(), type, angle, vz, GetDefaultSpeed (type));
}

AActor *P_SpawnMissileAngleZ (AActor *source, double z, PClassActor *type, DAngle angle, double vz)
{
if (type == nullptr)
{
return nullptr;
}
return P_SpawnMissileAngleZSpeed (source, z, type, angle, vz, GetDefaultSpeed (type));
}

AActor *P_SpawnMissileZAimed (AActor *source, double z, AActor *dest, PClassActor *type)
{
if (source == nullptr || type == nullptr)
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/actors/actor.zs
Expand Up @@ -875,9 +875,9 @@ class Actor : Thinker native
return SpawnMissileAngleZSpeed (pos.z + 32 + GetBobOffset(), type, angle, vz, GetDefaultSpeed (type));
}

Actor SpawnMissileAngleZ (double z, class<Actor> type, double angle, double vz)
Actor SpawnMissileAngleZ (double z, class<Actor> type, double angle, double vz, Actor owner = null)
{
return SpawnMissileAngleZSpeed (z, type, angle, vz, GetDefaultSpeed (type));
return SpawnMissileAngleZSpeed (z, type, angle, vz, GetDefaultSpeed (type), owner);
}


Expand Down
6 changes: 1 addition & 5 deletions wadsrc/static/zscript/actors/hexen/iceguy.zs
Expand Up @@ -169,11 +169,7 @@ class IceGuyFX : Actor
{
for (int i = 0; i < 8; i++)
{
Actor mo = SpawnMissileAngleZ (pos.z+3, "IceGuyFX2", i*45., -0.3);
if (mo)
{
mo.target = target;
}
SpawnMissileAngleZ (pos.z+3, "IceGuyFX2", i*45., -0.3, target);
}
}
}
Expand Down

0 comments on commit e19b1b2

Please sign in to comment.