- Be stricter about types accepted by spawning functions.

SVN r2265 (scripting)
This commit is contained in:
Randy Heit 2010-04-03 04:07:17 +00:00
parent 549ddf8035
commit 06995e26d9
59 changed files with 192 additions and 186 deletions

View file

@ -40,6 +40,8 @@
#include "r_blend.h"
#include "s_sound.h"
class PClassAmmo;
//
// NOTES: AActor
//
@ -625,13 +627,13 @@ public:
}
// Adds one item of a particular type. Returns NULL if it could not be added.
AInventory *GiveInventoryType (const PClass *type);
AInventory *GiveInventoryType (PClassActor *type);
// Returns the first item held with IF_INVBAR set.
AInventory *FirstInv ();
// Tries to give the actor some ammo.
bool GiveAmmo (const PClass *type, int amount);
bool GiveAmmo (PClassAmmo *type, int amount);
// Destroys all the inventory the actor is holding.
void DestroyAllInventory ();
@ -948,18 +950,10 @@ public:
}
};
inline AActor *Spawn (PClass *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)
inline AActor *Spawn (PClassActor *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)
{
return AActor::StaticSpawn (dyn_cast<PClassActor>(type), x, y, z, allowreplacement);
return AActor::StaticSpawn (type, x, y, z, allowreplacement);
}
inline AActor *Spawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)
{
// Thanks to some fiddling while determining replacements, type is modified, but only
// temporarily.
return AActor::StaticSpawn (const_cast<PClassActor *>(dyn_cast<PClassActor>(type)), x, y, z, allowreplacement);
}
AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement);
AActor *Spawn (FName classname, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement);

View file

@ -2896,7 +2896,7 @@ void ModifyDropAmount(AInventory *inv, int dropamount);
bool ADehackedPickup::TryPickup (AActor *&toucher)
{
const PClass *type = DetermineType ();
PClassActor *type = DetermineType ();
if (type == NULL)
{
return false;
@ -2968,7 +2968,7 @@ void ADehackedPickup::Destroy ()
Super::Destroy ();
}
const PClass *ADehackedPickup::DetermineType ()
PClassActor *ADehackedPickup::DetermineType ()
{
// Look at the actor's current sprite to determine what kind of
// item to pretend to me.
@ -2981,7 +2981,7 @@ const PClass *ADehackedPickup::DetermineType ()
int lex = memcmp (DehSpriteMappings[mid].Sprite, sprites[sprite].name, 4);
if (lex == 0)
{
return PClass::FindClass (DehSpriteMappings[mid].ClassName);
return PClass::FindActor(DehSpriteMappings[mid].ClassName);
}
else if (lex < 0)
{

View file

@ -50,7 +50,7 @@ public:
void DoPickupSpecial (AActor *toucher);
void Serialize(FArchive &arc);
private:
const PClass *DetermineType ();
PClassActor *DetermineType ();
AInventory *RealPickup;
public:
bool droppedbymonster;

View file

@ -250,7 +250,7 @@ public:
userinfo_t userinfo; // [RH] who is this?
const PClass *cls; // class of associated PlayerPawn
PClassPlayerPawn *cls; // class of associated PlayerPawn
float DesiredFOV; // desired field of vision
float FOV; // current field of vision
@ -302,7 +302,7 @@ public:
int morphTics; // player is a chicken/pig if > 0
BYTE MorphedPlayerClass; // [MH] (for SBARINFO) class # for this player instance when morphed
int MorphStyle; // which effects to apply for this player instance when morphed
const PClass *MorphExitFlash; // flash to apply when demorphing (cache of value given to P_MorphPlayer)
PClassActor *MorphExitFlash; // flash to apply when demorphing (cache of value given to P_MorphPlayer)
TObjPtr<AWeapon> PremorphWeapon; // ready weapon before morphing
int chickenPeck; // chicken peck countdown
int jumpTics; // delay the next jump for a moment

View file

@ -1043,7 +1043,7 @@ FArchive &FArchive::WriteObject (DObject *obj)
}
else
{
const PClass *type = RUNTIME_TYPE(obj);
PClass *type = RUNTIME_TYPE(obj);
if (type == RUNTIME_CLASS(DObject))
{
@ -1361,7 +1361,7 @@ DWORD FArchive::FindName (const char *name, unsigned int bucket) const
return (DWORD)map;
}
DWORD FArchive::WriteClass (const PClass *info)
DWORD FArchive::WriteClass (PClass *info)
{
if (m_ClassCount >= PClass::m_Types.Size())
{
@ -1378,7 +1378,7 @@ DWORD FArchive::WriteClass (const PClass *info)
return m_ClassCount++;
}
const PClass *FArchive::ReadClass ()
PClass *FArchive::ReadClass ()
{
struct String {
String() { val = NULL; }
@ -1410,9 +1410,9 @@ const PClass *FArchive::ReadClass ()
return NULL;
}
const PClass *FArchive::ReadClass (const PClass *wanttype)
PClass *FArchive::ReadClass (const PClass *wanttype)
{
const PClass *type = ReadClass ();
PClass *type = ReadClass ();
if (!type->IsDescendantOf (wanttype))
{
I_Error ("Expected to extract an object of type '%s'.\n"
@ -1422,14 +1422,14 @@ const PClass *FArchive::ReadClass (const PClass *wanttype)
return type;
}
const PClass *FArchive::ReadStoredClass (const PClass *wanttype)
PClass *FArchive::ReadStoredClass (const PClass *wanttype)
{
DWORD index = ReadCount ();
if (index >= m_ClassCount)
{
I_Error ("Class reference too high (%u; max is %u)\n", index, m_ClassCount);
}
const PClass *type = m_TypeMap[index].toCurrent;
PClass *type = m_TypeMap[index].toCurrent;
if (!type->IsDescendantOf (wanttype))
{
I_Error ("Expected to extract an object of type '%s'.\n"
@ -1479,7 +1479,7 @@ DWORD FArchive::FindObjectIndex (const DObject *obj) const
return index;
}
void FArchive::UserWriteClass (const PClass *type)
void FArchive::UserWriteClass (PClass *type)
{
BYTE id;
@ -1505,7 +1505,7 @@ void FArchive::UserWriteClass (const PClass *type)
}
}
void FArchive::UserReadClass (const PClass *&type)
void FArchive::UserReadClass (PClass *&type)
{
BYTE newclass;
@ -1527,7 +1527,7 @@ void FArchive::UserReadClass (const PClass *&type)
}
}
FArchive &operator<< (FArchive &arc, const PClass * &info)
FArchive &operator<< (FArchive &arc, PClass *&info)
{
if (arc.IsStoring ())
{

View file

@ -167,13 +167,13 @@ virtual void Read (void *mem, unsigned int len);
void WriteCount (DWORD count);
DWORD ReadCount ();
void UserWriteClass (const PClass *info);
void UserReadClass (const PClass *&info);
template<typename T> void UserReadClass(const T *&info)
void UserWriteClass (PClass *info);
void UserReadClass (PClass *&info);
template<typename T> void UserReadClass(T *&info)
{
const PClass *myclass;
PClass *myclass;
UserReadClass(myclass);
info = dyn_cast<T>(const_cast<PClass *>(myclass));
info = dyn_cast<T>(myclass);
}
FArchive& operator<< (BYTE &c);
@ -211,10 +211,10 @@ protected:
DWORD FindObjectIndex (const DObject *obj) const;
DWORD MapObject (const DObject *obj);
DWORD WriteClass (const PClass *info);
const PClass *ReadClass ();
const PClass *ReadClass (const PClass *wanttype);
const PClass *ReadStoredClass (const PClass *wanttype);
DWORD WriteClass (PClass *info);
PClass *ReadClass ();
PClass *ReadClass (const PClass *wanttype);
PClass *ReadStoredClass (const PClass *wanttype);
DWORD HashObject (const DObject *obj) const;
DWORD AddName (const char *name);
DWORD AddName (unsigned int start); // Name has already been added to storage
@ -232,8 +232,8 @@ protected:
struct TypeMap
{
const PClass *toCurrent; // maps archive type index to execution type index
DWORD toArchive; // maps execution type index to archive type index
PClass *toCurrent; // maps archive type index to execution type index
DWORD toArchive; // maps execution type index to archive type index
enum { NO_INDEX = 0xffffffff };
} *m_TypeMap;
@ -287,7 +287,7 @@ inline FArchive &operator<< (FArchive &arc, T* &object)
return arc.SerializeObject ((DObject*&)object, RUNTIME_CLASS(T));
}
FArchive &operator<< (FArchive &arc, const PClass * &info);
FArchive &operator<< (FArchive &arc, PClass * &info);
class FFont;
FArchive &SerializeFFontPtr (FArchive &arc, FFont* &font);

View file

@ -17,7 +17,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BspiAttack)
A_FaceTarget (self);
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("ArachnotronPlasma"));
P_SpawnMissile (self, self->target, PClass::FindActor("ArachnotronPlasma"));
return 0;
}

View file

@ -152,7 +152,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
return 0;
}
static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound)
static void SpawnFly(AActor *self, PClassActor *spawntype, FSoundID sound)
{
AActor *newmobj;
AActor *fog;
@ -242,7 +242,7 @@ static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound)
else if (r < 246) SpawnName = "HellKnight";
else SpawnName = "BaronOfHell";
}
spawntype = PClass::FindClass(SpawnName);
spawntype = PClass::FindActor(SpawnName);
if (spawntype != NULL)
{
newmobj = Spawn (spawntype, targ->x, targ->y, targ->z, ALLOW_REPLACE);
@ -293,6 +293,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnSound)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "brain/cube", 1, ATTN_IDLE);
SpawnFly(self, PClass::FindClass("SpawnFire"), "brain/spawn");
SpawnFly(self, PClass::FindActor("SpawnFire"), "brain/spawn");
return 0;
}

View file

@ -18,6 +18,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_BruisAttack)
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("BaronBall"));
P_SpawnMissile (self, self->target, PClass::FindActor("BaronBall"));
return 0;
}

View file

@ -30,6 +30,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_HeadAttack)
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("CacodemonBall"));
P_SpawnMissile (self, self->target, PClass::FindActor("CacodemonBall"));
return 0;
}

View file

@ -15,7 +15,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CyberAttack)
return 0;
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("Rocket"));
P_SpawnMissile (self, self->target, PClass::FindActor("Rocket"));
return 0;
}

View file

@ -33,6 +33,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_TroopAttack)
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("DoomImpBall"));
P_SpawnMissile (self, self->target, PClass::FindActor("DoomImpBall"));
return 0;
}

View file

@ -124,8 +124,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
// Original idea: Linguica
//
AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const PClass *type);
enum
{
MSF_Standard = 0,

View file

@ -12,9 +12,9 @@
DECLARE_ACTION(A_SkullAttack)
static const PClass *GetSpawnType(VMValue *param)
static PClassActor *GetSpawnType(VMValue *param)
{
const PClass *spawntype;
PClassActor *spawntype;
if (param == NULL || param->Type == REGT_NIL)
{
@ -24,10 +24,10 @@ static const PClass *GetSpawnType(VMValue *param)
{
assert(param->Type == REGT_POINTER);
assert(param->atag == ATAG_OBJECT || param->a == NULL);
spawntype = (const PClass *)param->a;
spawntype = (PClassActor *)param->a;
}
return (spawntype != NULL) ? spawntype : PClass::FindClass("LostSoul");
return (spawntype != NULL) ? spawntype : PClass::FindActor("LostSoul");
}
@ -35,7 +35,7 @@ static const PClass *GetSpawnType(VMValue *param)
// A_PainShootSkull
// Spawn a lost soul and launch it at the target
//
void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype)
void A_PainShootSkull (AActor *self, angle_t angle, PClassActor *spawntype)
{
fixed_t x, y, z;
@ -150,7 +150,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainAttack)
if (!self->target)
return 0;
const PClass *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
PClassActor *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
A_FaceTarget (self);
A_PainShootSkull (self, self->angle, spawntype);
return 0;
@ -163,7 +163,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DualPainAttack)
if (!self->target)
return 0;
const PClass *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
PClassActor *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
A_FaceTarget (self);
A_PainShootSkull (self, self->angle + ANG45, spawntype);
A_PainShootSkull (self, self->angle - ANG45, spawntype);
@ -178,7 +178,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainDie)
{ // And I thought you were my friend!
self->flags &= ~MF_FRIENDLY;
}
const PClass *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
PClassActor *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
CALL_ACTION(A_NoBlocking, self);
A_PainShootSkull (self, self->angle + ANG90, spawntype);
A_PainShootSkull (self, self->angle + ANG180, spawntype);

View file

@ -29,7 +29,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile)
A_FaceTarget (self);
missile = P_SpawnMissileZ (self, self->z + 48*FRACUNIT,
self->target, PClass::FindClass("RevenantTracer"));
self->target, PClass::FindActor("RevenantTracer"));
if (missile != NULL)
{

View file

@ -523,7 +523,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireMissile)
else
{
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("Rocket"));
P_SpawnMissile (self, self->target, PClass::FindActor("Rocket"));
}
return 0;
}
@ -560,7 +560,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FirePlasma)
return 0;
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("PlasmaBall"));
P_SpawnMissile (self, self->target, PClass::FindActor("PlasmaBall"));
self->special1 = level.maptime + 20;
return 0;
}
@ -606,7 +606,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireBFG)
return 0;
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("BFGBall"));
P_SpawnMissile (self, self->target, PClass::FindActor("BFGBall"));
self->special1 = level.maptime + 30;
self->PainChance = MARINE_PAIN_CHANCE;
return 0;

View file

@ -1283,7 +1283,7 @@ void G_PlayerReborn (int player)
userinfo_t userinfo; // [RH] Save userinfo
botskill_t b_skill;//Added by MC:
APlayerPawn *actor;
const PClass *cls;
PClassPlayerPawn *cls;
FString log;
p = &players[player];

View file

@ -94,12 +94,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
randAttack = pr_atk ();
if (randAttack < atkResolve1[dist])
{ // Ice ball
P_SpawnMissile (self, target, PClass::FindClass("HeadFX1"));
P_SpawnMissile (self, target, PClass::FindActor("HeadFX1"));
S_Sound (self, CHAN_BODY, "ironlich/attack2", 1, ATTN_NORM);
}
else if (randAttack < atkResolve2[dist])
{ // Fire column
baseFire = P_SpawnMissile (self, target, PClass::FindClass("HeadFX3"));
baseFire = P_SpawnMissile (self, target, PClass::FindActor("HeadFX3"));
if (baseFire != NULL)
{
baseFire->SetState (baseFire->FindState("NoGrow"));

View file

@ -61,11 +61,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_KnightAttack)
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM);
if (self->flags & MF_SHADOW || pr_knightatk () < 40)
{ // Red axe
P_SpawnMissileZ (self, self->z + 36*FRACUNIT, self->target, PClass::FindClass("RedAxe"));
P_SpawnMissileZ (self, self->z + 36*FRACUNIT, self->target, PClass::FindActor("RedAxe"));
return 0;
}
// Green axe
P_SpawnMissileZ (self, self->z + 36*FRACUNIT, self->target, PClass::FindClass("KnightAxe"));
P_SpawnMissileZ (self, self->z + 36*FRACUNIT, self->target, PClass::FindActor("KnightAxe"));
return 0;
}

View file

@ -61,7 +61,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack2)
self->SetState (self->SeeState);
return 0;
}
mo = P_SpawnMissile (self, self->target, PClass::FindClass("BishopFX"));
mo = P_SpawnMissile (self, self->target, PClass::FindActor("BishopFX"));
if (mo != NULL)
{
mo->tracer = self->target;

View file

@ -22,7 +22,7 @@
//
//==========================================================================
void BlastActor (AActor *victim, fixed_t strength, fixed_t speed, AActor * Owner, const PClass * blasteffect)
void BlastActor (AActor *victim, fixed_t strength, fixed_t speed, AActor *Owner, PClassActor *blasteffect)
{
angle_t angle,ang;
AActor *mo;

View file

@ -574,7 +574,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ClericAttack)
if (!self->target) return 0;
AActor * missile = P_SpawnMissileZ (self, self->z + 40*FRACUNIT, self->target, PClass::FindClass ("HolyMissile"));
AActor * missile = P_SpawnMissileZ (self, self->z + 40*FRACUNIT, self->target, PClass::FindActor("HolyMissile"));
if (missile != NULL) missile->tracer = NULL; // No initial target
S_Sound (self, CHAN_WEAPON, "HolySymbolFire", 1, ATTN_NORM);
return 0;

View file

@ -93,7 +93,7 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
}
else if (pr_dragonseek() < 128 && P_CheckMissileRange(actor))
{
P_SpawnMissile(actor, target, PClass::FindClass ("DragonFireball"));
P_SpawnMissile(actor, target, PClass::FindActor("DragonFireball"));
S_Sound (actor, CHAN_WEAPON, actor->AttackSound, 1, ATTN_NORM);
}
actor->target = oldTarget;
@ -255,7 +255,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonAttack)
{
PARAM_ACTION_PROLOGUE;
P_SpawnMissile (self, self->target, PClass::FindClass ("DragonFireball"));
P_SpawnMissile (self, self->target, PClass::FindActor("DragonFireball"));
return 0;
}

View file

@ -70,7 +70,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces)
for (int i = 0, j = 0, fineang = 0; i < 3; ++i)
{
const PClass *cls = j==0? p1 : j==1? p2 : p3;
PClassActor *cls = j == 0 ? p1 : j == 1 ? p2 : p3;
if (cls)
{
AActor *piece = Spawn (cls, self->x, self->y, self->z, ALLOW_REPLACE);

View file

@ -33,25 +33,25 @@ void A_FiredSpawnRock (AActor *actor)
{
AActor *mo;
int x,y,z;
const PClass *rtype;
PClassActor *rtype;
switch (pr_firedemonrock() % 5)
{
case 0:
rtype = PClass::FindClass ("FireDemonRock1");
rtype = PClass::FindActor("FireDemonRock1");
break;
case 1:
rtype = PClass::FindClass ("FireDemonRock2");
rtype = PClass::FindActor("FireDemonRock2");
break;
case 2:
rtype = PClass::FindClass ("FireDemonRock3");
rtype = PClass::FindActor("FireDemonRock3");
break;
case 3:
rtype = PClass::FindClass ("FireDemonRock4");
rtype = PClass::FindActor("FireDemonRock4");
break;
case 4:
default:
rtype = PClass::FindClass ("FireDemonRock5");
rtype = PClass::FindActor("FireDemonRock5");
break;
}
@ -121,7 +121,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredAttack)
if (self->target == NULL)
return 0;
AActor *mo = P_SpawnMissile (self, self->target, PClass::FindClass ("FireDemonMissile"));
AActor *mo = P_SpawnMissile (self, self->target, PClass::FindActor("FireDemonMissile"));
if (mo) S_Sound (self, CHAN_BODY, "FireDemonAttack", 1, ATTN_NORM);
return 0;
}

View file

@ -204,7 +204,7 @@ AInventory *AArtiPoisonBag::CreateCopy (AActor *other)
}
AInventory *copy;
const PClass *spawntype;
PClassActor *spawntype;
if (other->IsKindOf (PClass::FindClass(NAME_ClericPlayer)))
{

View file

@ -70,8 +70,8 @@ bool AArtiHealingRadius::Use (bool pickup)
{
int amount = 50 + (pr_healradius() % 50);
if (players[i].mo->GiveAmmo (PClass::FindClass(NAME_Mana1), amount) ||
players[i].mo->GiveAmmo (PClass::FindClass(NAME_Mana2), amount))
if (players[i].mo->GiveAmmo (dyn_cast<PClassAmmo>(PClass::FindClass(NAME_Mana1)), amount) ||
players[i].mo->GiveAmmo (dyn_cast<PClassAmmo>(PClass::FindClass(NAME_Mana2)), amount))
{
gotsome = true;
}

View file

@ -214,7 +214,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafSpawn)
for (i = (pr_leaf()&3)+1; i; i--)
{
mo = Spawn (pr_leaf()&1 ? PClass::FindClass ("Leaf1") : PClass::FindClass ("Leaf2"),
mo = Spawn (pr_leaf()&1 ? PClass::FindActor("Leaf1") : PClass::FindActor("Leaf2"),
self->x + (pr_leaf.Random2()<<14),
self->y + (pr_leaf.Random2()<<14),
self->z + (pr_leaf()<<14), ALLOW_REPLACE);

View file

@ -100,12 +100,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
P_SpawnMissileXYZ(self->x+FixedMul(self->radius>>1,
finecosine[an]), self->y+FixedMul(self->radius>>1,
finesine[an]), self->z+40*FRACUNIT, self, self->target,
PClass::FindClass ("IceGuyFX"));
PClass::FindActor("IceGuyFX"));
an = (self->angle-ANG90)>>ANGLETOFINESHIFT;
P_SpawnMissileXYZ(self->x+FixedMul(self->radius>>1,
finecosine[an]), self->y+FixedMul(self->radius>>1,
finesine[an]), self->z+40*FRACUNIT, self, self->target,
PClass::FindClass ("IceGuyFX"));
PClass::FindActor("IceGuyFX"));
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
return 0;
}

View file

@ -74,10 +74,10 @@ void A_KSpiritRoam (AActor *);
void A_KBolt (AActor *);
void A_KBoltRaise (AActor *);
void KoraxFire (AActor *actor, const PClass *type, int arm);
void KoraxFire (AActor *actor, PClassActor *type, int arm);
void KSpiritInit (AActor *spirit, AActor *korax);
AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z,
AActor *source, AActor *dest, const PClass *type);
AActor *source, AActor *dest, PClassActor *type);
extern void SpawnSpiritTail (AActor *spirit);
@ -237,11 +237,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxMissile)
int type = pr_koraxmissile()%6;
int i;
const PClass *info;
PClassActor *info;
S_Sound (self, CHAN_VOICE, "KoraxAttack", 1, ATTN_NORM);
info = PClass::FindClass (choices[type].type);
info = PClass::FindActor(choices[type].type);
if (info == NULL)
{
I_Error ("Unknown Korax missile: %s\n", choices[type].type);
@ -310,7 +310,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxCommand)
//
//============================================================================
void KoraxFire (AActor *actor, const PClass *type, int arm)
void KoraxFire (AActor *actor, PClassActor *type, int arm)
{
static const int extension[6] =
{
@ -533,7 +533,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KBoltRaise)
//============================================================================
AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z,
AActor *source, AActor *dest, const PClass *type)
AActor *source, AActor *dest, PClassActor *type)
{
AActor *th;
angle_t an;

View file

@ -246,15 +246,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
}
if (self->special1 > 0)
{
const PClass *type;
PClassActor *type;
if (gameinfo.gametype == GAME_Heretic)
{
type = PClass::FindClass ("PhoenixPuff");
type = PClass::FindActor("PhoenixPuff");
}
else
{
type = PClass::FindClass ("PunchPuff");
type = PClass::FindActor("PunchPuff");
}
puff = Spawn (type, self->x, self->y, self->z, ALLOW_REPLACE);
puff->velz = 2*FRACUNIT;
@ -362,7 +362,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk3)
}
else
{
mo = P_SpawnMissile (self, self->target, PClass::FindClass("MinotaurFX2"));
mo = P_SpawnMissile (self, self->target, PClass::FindActor("MinotaurFX2"));
if (mo != NULL)
{
S_Sound (mo, CHAN_WEAPON, "minotaur/attack1", 1, ATTN_NORM);

View file

@ -91,8 +91,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
{
if (di->Name != NAME_None)
{
const PClass *ti = PClass::FindClass(di->Name);
if (ti) P_DropItem (self, ti, di->Amount, di->Probability);
PClassActor *ti = PClass::FindActor(di->Name);
if (ti != NULL)
{
P_DropItem (self, ti, di->Amount, di->Probability);
}
}
di = di->Next;
}

View file

@ -1727,8 +1727,8 @@ void APowerMorph::InitEffect( )
if (Owner != NULL && Owner->player != NULL && PlayerClass != NAME_None)
{
player_t *realplayer = Owner->player; // Remember the identity of the player
const PClass *morph_flash = PClass::FindClass (MorphFlash);
const PClass *unmorph_flash = PClass::FindClass (UnMorphFlash);
PClassActor *morph_flash = PClass::FindActor(MorphFlash);
PClassActor *unmorph_flash = PClass::FindActor(UnMorphFlash);
PClassPlayerPawn *player_class = dyn_cast<PClassPlayerPawn>(PClass::FindClass (PlayerClass));
if (P_MorphPlayer(realplayer, realplayer, player_class, -1/*INDEFINITELY*/, MorphStyle, morph_flash, unmorph_flash))
{

View file

@ -32,7 +32,7 @@ IMPLEMENT_CLASS(AGlassShard)
void P_SpawnDirt (AActor *actor, fixed_t radius)
{
fixed_t x,y,z;
const PClass *dtype = NULL;
PClassActor *dtype = NULL;
AActor *mo;
angle_t angle;
@ -43,7 +43,7 @@ void P_SpawnDirt (AActor *actor, fixed_t radius)
char fmt[8];
mysnprintf(fmt, countof(fmt), "Dirt%d", 1 + pr_dirt()%6);
dtype = PClass::FindClass(fmt);
dtype = PClass::FindActor(fmt);
if (dtype)
{
mo = Spawn (dtype, x, y, z, ALLOW_REPLACE);

View file

@ -163,7 +163,7 @@ void AFastProjectile::Effect()
hitz = floorz;
}
const PClass *trail = PClass::FindClass(name);
PClassActor *trail = PClass::FindActor(name);
if (trail != NULL)
{
AActor *act = Spawn (trail, x, y, hitz, ALLOW_REPLACE);

View file

@ -25,7 +25,7 @@ static FRandom pr_morphmonst ("MorphMonster");
//
//---------------------------------------------------------------------------
bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntype, int duration, int style, const PClass *enter_flash, const PClass *exit_flash)
bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntype, int duration, int style, PClassActor *enter_flash, PClassActor *exit_flash)
{
AInventory *item;
APlayerPawn *morphed;
@ -246,7 +246,7 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
mo->flags2 = (mo->flags2 & ~MF2_FLY) | (pmo->flags2 & MF2_FLY);
mo->flags3 = (mo->flags3 & ~MF3_GHOST) | (pmo->flags3 & MF3_GHOST);
const PClass *exit_flash = player->MorphExitFlash;
PClassActor *exit_flash = player->MorphExitFlash;
bool correctweapon = !!(player->MorphStyle & MORPH_LOSEACTUALWEAPON);
bool undobydeathsaves = !!(player->MorphStyle & MORPH_UNDOBYDEATHSAVES);
@ -372,7 +372,7 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
//
//---------------------------------------------------------------------------
bool P_MorphMonster (AActor *actor, const PClass *spawntype, int duration, int style, const PClass *enter_flash, const PClass *exit_flash)
bool P_MorphMonster (AActor *actor, PClassActor *spawntype, int duration, int style, PClassActor *enter_flash, PClassActor *exit_flash)
{
AMorphedMonster *morphed;
@ -464,7 +464,7 @@ bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force)
actor->AddToHash ();
beast->UnmorphedMe = NULL;
DObject::StaticPointerSubstitution (beast, actor);
const PClass *exit_flash = beast->MorphExitFlash;
PClassActor *exit_flash = beast->MorphExitFlash;
beast->Destroy ();
Spawn(exit_flash, beast->x, beast->y, beast->z + TELEFOGHEIGHT, ALLOW_REPLACE);
return true;
@ -552,8 +552,8 @@ IMPLEMENT_CLASS(AMorphProjectile)
int AMorphProjectile::DoSpecialDamage (AActor *target, int damage)
{
const PClass *morph_flash = PClass::FindClass (MorphFlash);
const PClass *unmorph_flash = PClass::FindClass (UnMorphFlash);
PClassActor *morph_flash = PClass::FindActor(MorphFlash);
PClassActor *unmorph_flash = PClass::FindActor(UnMorphFlash);
if (target->player)
{
PClassPlayerPawn *player_class = dyn_cast<PClassPlayerPawn>(PClass::FindClass(PlayerClass));
@ -561,7 +561,7 @@ int AMorphProjectile::DoSpecialDamage (AActor *target, int damage)
}
else
{
const PClass *monster_class = PClass::FindClass (MonsterClass);
PClassActor *monster_class = PClass::FindActor(MonsterClass);
P_MorphMonster (target, monster_class, Duration, MorphStyle, morph_flash, unmorph_flash);
}
return -1;

View file

@ -34,10 +34,10 @@ class player_t;
class AMorphedMonster;
bool P_MorphPlayer (player_t *activator, player_t *player, PClassPlayerPawn *morphclass, int duration = 0, int style = 0,
const PClass *enter_flash = NULL, const PClass *exit_flash = NULL);
PClassActor *enter_flash = NULL, PClassActor *exit_flash = NULL);
bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag = 0, bool force = false);
bool P_MorphMonster (AActor *actor, const PClass *morphclass, int duration = 0, int style = 0,
const PClass *enter_flash = NULL, const PClass *exit_flash = NULL);
bool P_MorphMonster (AActor *actor, PClassActor *morphclass, int duration = 0, int style = 0,
PClassActor *enter_flash = NULL, PClassActor *exit_flash = NULL);
bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force = false);
bool P_UpdateMorphedMonster (AActor *actor);
bool P_MorphedDeath(AActor *actor, AActor **morphed, int *morphedstyle, int *morphedhealth);

View file

@ -1660,7 +1660,7 @@ AInventory *ABackpackItem::CreateCopy (AActor *other)
if (amount < 0) amount = 0;
if (ammo == NULL)
{ // The player did not have the ammo. Add it.
ammo = static_cast<AAmmo *>(Spawn (type, 0, 0, 0, NO_REPLACE));
ammo = static_cast<AAmmo *>(Spawn(atype, 0, 0, 0, NO_REPLACE));
ammo->Amount = bDepleted ? 0 : amount;
if (ammo->BackpackMaxAmount > ammo->MaxAmount)
{

View file

@ -100,16 +100,26 @@ class ARandomSpawner : public AActor
// necessary to them -- such as their source and destination.
void PostBeginPlay()
{
AActor * newmobj = NULL;
AActor *newmobj = NULL;
bool boss = false;
if (Species == NAME_None) { Destroy(); return; }
const PClass * cls = PClass::FindClass(Species);
if (Species == NAME_None)
{
Destroy();
return;
}
PClassActor *cls = PClass::FindActor(Species);
if (this->flags & MF_MISSILE && target && target->target) // Attempting to spawn a missile.
{
if ((tracer == NULL) && (flags2 & MF2_SEEKERMISSILE)) tracer = target->target;
if ((tracer == NULL) && (flags2 & MF2_SEEKERMISSILE))
{
tracer = target->target;
}
newmobj = P_SpawnMissileXYZ(x, y, z, target, target->target, cls, false);
}
else newmobj = Spawn(cls, x, y, z, NO_REPLACE);
else
{
newmobj = Spawn(cls, x, y, z, NO_REPLACE);
}
if (newmobj != NULL)
{
// copy everything relevant

View file

@ -176,7 +176,7 @@ public:
TObjPtr<AActor> UnmorphedMe;
int UnmorphTime, MorphStyle;
const PClass *MorphExitFlash;
PClassActor *MorphExitFlash;
DWORD FlagsSave;
};

View file

@ -16,8 +16,6 @@
static FRandom pr_spectrespawn ("AlienSpectreSpawn");
static FRandom pr_spectrechunk ("212e4");
AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target);
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkSmall)
@ -80,7 +78,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack)
for (int i = 0; i < 20; ++i)
{
self->angle += ANGLE_180 / 20;
P_SpawnSubMissile (self, PClass::FindClass("SpectralLightningBall2"), self);
P_SpawnSubMissile (self, PClass::FindActor("SpectralLightningBall2"), self);
}
self->angle -= ANGLE_180 / 20 * 10;
return 0;

View file

@ -28,7 +28,7 @@ void A_SpectralMissile (AActor *self, const char *missilename)
if (self->target != NULL)
{
AActor *missile = P_SpawnMissileXYZ (self->x, self->y, self->z + 32*FRACUNIT,
self, self->target, PClass::FindClass(missilename), false);
self, self->target, PClass::FindActor(missilename), false);
if (missile != NULL)
{
missile->tracer = self->target;

View file

@ -9,8 +9,6 @@
#include "thingdef/thingdef.h"
*/
AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target);
class ASpectralMonster : public AActor
{
DECLARE_CLASS (ASpectralMonster, AActor)
@ -41,7 +39,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralBigBallLightning)
{
PARAM_ACTION_PROLOGUE;
const PClass *cls = PClass::FindClass("SpectralLightningH3");
PClassActor *cls = PClass::FindActor("SpectralLightningH3");
if (cls)
{
self->angle += ANGLE_90;
@ -72,8 +70,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
x = self->x + pr_zap5.Random2(3) * FRACUNIT * 50;
y = self->y + pr_zap5.Random2(3) * FRACUNIT * 50;
flash = Spawn (self->threshold > 25 ? PClass::FindClass(NAME_SpectralLightningV2) :
PClass::FindClass(NAME_SpectralLightningV1), x, y, ONCEILINGZ, ALLOW_REPLACE);
flash = Spawn (self->threshold > 25 ? PClass::FindActor(NAME_SpectralLightningV2) :
PClass::FindActor(NAME_SpectralLightningV1), x, y, ONCEILINGZ, ALLOW_REPLACE);
flash->target = self->target;
flash->velz = -18*FRACUNIT;

View file

@ -81,7 +81,7 @@ bool AHealthTraining::TryPickup (AActor *&toucher)
{
if (Super::TryPickup (toucher))
{
toucher->GiveInventoryType (PClass::FindClass("GunTraining"));
toucher->GiveInventoryType (PClass::FindActor("GunTraining"));
AInventory *coin = Spawn<ACoin> (0,0,0, NO_REPLACE);
if (coin != NULL)
{

View file

@ -566,7 +566,7 @@ void APowerCoupling::Die (AActor *source, AActor *inflictor)
players[i].mo->GiveInventoryType (QuestItemClasses[5]);
S_Sound (CHAN_VOICE, "svox/voc13", 1, ATTN_NORM);
players[i].SetLogNumber (13);
P_DropItem (this, PClass::FindClass("BrokenPowerCoupling"), -1, 256);
P_DropItem (this, PClass::FindActor("BrokenPowerCoupling"), -1, 256);
Destroy ();
}

View file

@ -522,8 +522,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
//
//============================================================================
AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target);
DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
{
PARAM_ACTION_PROLOGUE;
@ -542,13 +540,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
for (int i = 0; i < 80; ++i)
{
self->angle += ANGLE_45/10;
P_SpawnSubMissile (self, PClass::FindClass("MaulerTorpedoWave"), self->target);
P_SpawnSubMissile (self, PClass::FindActor("MaulerTorpedoWave"), self->target);
}
self->z = savedz;
return 0;
}
AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target)
AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
{
AActor *other = Spawn (type, source->x, source->y, source->z, ALLOW_REPLACE);
@ -1040,7 +1038,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
for (i = 0; i < 20; ++i)
{
self->angle += ANGLE_180/20;
spot = P_SpawnSubMissile (self, PClass::FindClass("SpectralLightningBall1"), self);
spot = P_SpawnSubMissile (self, PClass::FindActor("SpectralLightningBall1"), self);
if (spot != NULL)
{
spot->z = self->z + 32*FRACUNIT;

View file

@ -95,8 +95,8 @@ struct FState
}
void SetAction(VMFunction *func) { ActionFunc = func; }
bool CallAction(AActor *self, AActor *stateowner, StateCallData *statecall = NULL);
static const PClassActor *StaticFindStateOwner (const FState *state);
static const PClassActor *StaticFindStateOwner (const FState *state, const PClassActor *info);
static PClassActor *StaticFindStateOwner (const FState *state);
static PClassActor *StaticFindStateOwner (const FState *state, PClassActor *info);
};
struct FStateLabels;

View file

@ -250,7 +250,7 @@ void cht_DoCheat (player_t *player, int cheat)
{
if (i != 0)
{
player->mo->GiveInventoryType (*BeholdPowers[i]);
player->mo->GiveInventoryType(static_cast<PClassActor *>(*BeholdPowers[i]));
if (cheat == CHT_BEHOLDS)
{
P_GiveBody (player->mo, -100);
@ -551,7 +551,7 @@ const char *cht_Morph (player_t *player, PClassPlayerPawn *morphclass, bool quic
return "";
}
void GiveSpawner (player_t *player, const PClass *type, int amount)
void GiveSpawner (player_t *player, PClassInventory *type, int amount)
{
if (player->mo == NULL || player->health <= 0)
{
@ -648,7 +648,7 @@ void cht_Give (player_t *player, const char *name, int amount)
type = PClass::FindClass(gameinfo.backpacktype);
if (type != NULL)
{
GiveSpawner (player, type, 1);
GiveSpawner (player, static_cast<PClassInventory *>(type), 1);
}
if (!giveall)
@ -665,10 +665,11 @@ void cht_Give (player_t *player, const char *name, int amount)
if (type->ParentClass == RUNTIME_CLASS(AAmmo))
{
AInventory *ammo = player->mo->FindInventory(static_cast<PClassActor *>(type));
PClassAmmo *atype = static_cast<PClassAmmo *>(type);
AInventory *ammo = player->mo->FindInventory(atype);
if (ammo == NULL)
{
ammo = static_cast<AInventory *>(Spawn (type, 0, 0, 0, NO_REPLACE));
ammo = static_cast<AInventory *>(Spawn (atype, 0, 0, 0, NO_REPLACE));
ammo->AttachToOwner (player->mo);
ammo->Amount = ammo->MaxAmount;
}
@ -722,7 +723,7 @@ void cht_Give (player_t *player, const char *name, int amount)
AKey *key = (AKey *)GetDefaultByType (PClass::m_Types[i]);
if (key->KeyNumber != 0)
{
key = static_cast<AKey *>(Spawn (PClass::m_Types[i], 0,0,0, NO_REPLACE));
key = static_cast<AKey *>(Spawn(static_cast<PClassActor *>(PClass::m_Types[i]), 0,0,0, NO_REPLACE));
if (!key->CallTryPickup (player->mo))
{
key->Destroy ();
@ -755,7 +756,7 @@ void cht_Give (player_t *player, const char *name, int amount)
AWeapon *def = (AWeapon*)GetDefaultByType (type);
if (!(def->WeaponFlags & WIF_CHEATNOTWEAPON))
{
GiveSpawner (player, type, 1);
GiveSpawner (player, static_cast<PClassInventory *>(type), 1);
}
}
}
@ -779,7 +780,7 @@ void cht_Give (player_t *player, const char *name, int amount)
!type->IsDescendantOf (RUNTIME_CLASS(APowerup)) &&
!type->IsDescendantOf (RUNTIME_CLASS(AArmor)))
{
GiveSpawner (player, type, 1);
GiveSpawner (player, static_cast<PClassInventory *>(type), 1);
}
}
}
@ -797,7 +798,7 @@ void cht_Give (player_t *player, const char *name, int amount)
AInventory *def = (AInventory*)GetDefaultByType (type);
if (def->Icon.isValid())
{
GiveSpawner (player, type, 1);
GiveSpawner (player, static_cast<PClassInventory *>(type), 1);
}
}
}
@ -816,7 +817,7 @@ void cht_Give (player_t *player, const char *name, int amount)
}
else
{
GiveSpawner (player, type, amount);
GiveSpawner (player, static_cast<PClassInventory *>(type), amount);
}
return;
}

View file

@ -424,7 +424,7 @@ static void ClearInventory (AActor *activator)
//
//============================================================================
static void DoGiveInv (AActor *actor, const PClass *info, int amount)
static void DoGiveInv (AActor *actor, PClassActor *info, int amount)
{
AWeapon *savedPendingWeap = actor->player != NULL
? actor->player->PendingWeapon : NULL;
@ -479,7 +479,7 @@ static void DoGiveInv (AActor *actor, const PClass *info, int amount)
static void GiveInventory (AActor *activator, const char *type, int amount)
{
const PClass *info;
PClassActor *info;
if (amount <= 0 || type == NULL)
{
@ -489,7 +489,7 @@ static void GiveInventory (AActor *activator, const char *type, int amount)
{
type = "BasicArmorPickup";
}
info = PClass::FindClass (type);
info = PClass::FindActor(type);
if (info == NULL)
{
Printf ("ACS: I don't know what %s is.\n", type);
@ -2259,7 +2259,7 @@ void DLevelScript::ReplaceTextures (int fromnamei, int tonamei, int flags)
int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle, bool force)
{
const PClass *info = PClass::FindClass (FBehavior::StaticLookupString (type));
PClassActor *info = PClass::FindActor(FBehavior::StaticLookupString (type));
AActor *actor = NULL;
int spawncount = 0;
@ -5536,7 +5536,7 @@ int DLevelScript::RunScript ()
}
else
{
item = activator->GiveInventoryType (type);
item = activator->GiveInventoryType (static_cast<PClassAmmo *>(type));
item->MaxAmount = STACK(1);
item->Amount = 0;
}
@ -6356,13 +6356,13 @@ int DLevelScript::RunScript ()
FName playerclass_name = FBehavior::StaticLookupString(STACK(6));
PClassPlayerPawn *playerclass = dyn_cast<PClassPlayerPawn>(PClass::FindClass (playerclass_name));
FName monsterclass_name = FBehavior::StaticLookupString(STACK(5));
const PClass *monsterclass = PClass::FindClass (monsterclass_name);
PClassActor *monsterclass = PClass::FindActor(monsterclass_name);
int duration = STACK(4);
int style = STACK(3);
FName morphflash_name = FBehavior::StaticLookupString(STACK(2));
const PClass *morphflash = PClass::FindClass (morphflash_name);
PClassActor *morphflash = PClass::FindActor(morphflash_name);
FName unmorphflash_name = FBehavior::StaticLookupString(STACK(1));
const PClass *unmorphflash = PClass::FindClass (unmorphflash_name);
PClassActor *unmorphflash = PClass::FindActor(unmorphflash_name);
int changes = 0;
if (tag == 0)

View file

@ -2907,7 +2907,7 @@ void ModifyDropAmount(AInventory *inv, int dropamount)
CVAR(Int, sv_dropstyle, 0, CVAR_SERVERINFO | CVAR_ARCHIVE);
AInventory *P_DropItem (AActor *source, const PClass *type, int dropamount, int chance)
AInventory *P_DropItem (AActor *source, PClassActor *type, int dropamount, int chance)
{
if (type != NULL && pr_dropitem() <= chance)
{
@ -2918,9 +2918,11 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int dropamount, int
if (!(i_compatflags & COMPATF_NOTOSSDROPS))
{
int style = sv_dropstyle;
if (style==0) style= (gameinfo.gametype == GAME_Strife)? 2:1;
if (style==2)
if (style == 0)
{
style = (gameinfo.gametype == GAME_Strife) ? 2 : 1;
}
if (style == 2)
{
spawnz += 24*FRACUNIT;
}
@ -2929,7 +2931,7 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int dropamount, int
spawnz += source->height / 2;
}
}
mo = Spawn (type, source->x, source->y, spawnz, ALLOW_REPLACE);
mo = Spawn(type, source->x, source->y, spawnz, ALLOW_REPLACE);
if (mo != NULL)
{
mo->flags |= MF_DROPPED;
@ -2940,7 +2942,7 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int dropamount, int
}
if (mo->IsKindOf (RUNTIME_CLASS(AInventory)))
{
AInventory * inv = static_cast<AInventory *>(mo);
AInventory *inv = static_cast<AInventory *>(mo);
ModifyDropAmount(inv, dropamount);
if (inv->SpecialDropAction (source))
{

View file

@ -51,7 +51,7 @@ bool P_CheckMeleeRange2 (AActor *actor);
bool P_Move (AActor *actor);
bool P_TryWalk (AActor *actor);
void P_NewChaseDir (AActor *actor);
AInventory *P_DropItem (AActor *source, const PClass *type, int special, int chance);
AInventory *P_DropItem (AActor *source, PClassActor *type, int special, int chance);
void P_TossItem (AActor *item);
bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params);
void A_Weave(AActor *self, int xyspeed, int zspeed, fixed_t xydist, fixed_t zdist);

View file

@ -2556,7 +2556,7 @@ FUNC(LS_SetPlayerProperty)
{ // Give power to activator
if (power != 4)
{
APowerup *item = static_cast<APowerup*>(it->GiveInventoryType (*powers[power]));
APowerup *item = static_cast<APowerup*>(it->GiveInventoryType(static_cast<PClassActor *>(*powers[power])));
if (item != NULL && power == 0 && arg1 == 1)
{
item->BlendColor = MakeSpecialColormap(INVERSECOLORMAP);

View file

@ -111,9 +111,10 @@ void P_RipperBlood (AActor *mo, AActor *bleeder);
int P_GetThingFloorType (AActor *thing);
void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target);
AActor *P_SpawnMissile (AActor* source, AActor* dest, const PClass *type, AActor* owner = NULL);
AActor *P_SpawnMissileZ (AActor* source, fixed_t z, AActor* dest, const PClass *type);
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, AActor *source, AActor *dest, const PClass *type, bool checkspawn = true, AActor *owner = NULL);
AActor * P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type);
AActor *P_SpawnMissile (AActor* source, AActor* dest, PClassActor *type, AActor* owner = NULL);
AActor *P_SpawnMissileZ (AActor* source, fixed_t z, AActor* dest, PClassActor *type);
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, AActor *source, AActor *dest, PClassActor *type, bool checkspawn = true, AActor *owner = NULL);
AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type, angle_t angle, fixed_t velz);
AActor *P_SpawnMissileAngleSpeed (AActor *source, PClassActor *type, angle_t angle, fixed_t velz, fixed_t speed);
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, PClassActor *type, angle_t angle, fixed_t velz);
@ -127,6 +128,9 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, P
void P_CheckFakeFloorTriggers (AActor *mo, fixed_t oldz, bool oldz_has_viewheight=false);
AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target); // Strife uses it
//
// [RH] P_THINGS
//

View file

@ -849,7 +849,7 @@ AInventory *AActor::FindInventory (FName type)
//
//============================================================================
AInventory *AActor::GiveInventoryType (const PClass *type)
AInventory *AActor::GiveInventoryType (PClassActor *type)
{
AInventory *item = NULL;
@ -873,7 +873,7 @@ AInventory *AActor::GiveInventoryType (const PClass *type)
//
//============================================================================
bool AActor::GiveAmmo (const PClass *type, int amount)
bool AActor::GiveAmmo (PClassAmmo *type, int amount)
{
if (type != NULL)
{
@ -5049,19 +5049,19 @@ static fixed_t GetDefaultSpeed(PClassActor *type)
//
//---------------------------------------------------------------------------
AActor *P_SpawnMissile (AActor *source, AActor *dest, const PClass *type, AActor *owner)
AActor *P_SpawnMissile (AActor *source, AActor *dest, PClassActor *type, AActor *owner)
{
return P_SpawnMissileXYZ (source->x, source->y, source->z + 32*FRACUNIT,
source, dest, type, true, owner);
}
AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, const PClass *type)
AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, PClassActor *type)
{
return P_SpawnMissileXYZ (source->x, source->y, z, source, dest, type);
}
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
AActor *source, AActor *dest, const PClass *type, bool checkspawn, AActor *owner)
AActor *source, AActor *dest, PClassActor *type, bool checkspawn, AActor *owner)
{
if (dest == NULL)
{
@ -5124,7 +5124,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
return (!checkspawn || P_CheckMissileSpawn (th)) ? th : NULL;
}
AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const PClass *type)
AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type)
{
angle_t an;
fixed_t dist;

View file

@ -60,7 +60,7 @@
FArchive &operator<< (FArchive &arc, FState *&state)
{
const PClassActor *info;
PClassActor *info;
if (arc.IsStoring ())
{
@ -94,7 +94,7 @@ FArchive &operator<< (FArchive &arc, FState *&state)
}
else
{
const PClassActor *info;
PClassActor *info;
DWORD ofs;
arc.UserReadClass<PClassActor>(info);
@ -117,7 +117,7 @@ FArchive &operator<< (FArchive &arc, FState *&state)
//
//==========================================================================
const PClassActor *FState::StaticFindStateOwner (const FState *state)
PClassActor *FState::StaticFindStateOwner (const FState *state)
{
for (unsigned int i = 0; i < PClass::m_RuntimeActors.Size(); ++i)
{
@ -139,7 +139,7 @@ const PClassActor *FState::StaticFindStateOwner (const FState *state)
//
//==========================================================================
const PClassActor *FState::StaticFindStateOwner (const FState *state, const PClassActor *info)
PClassActor *FState::StaticFindStateOwner (const FState *state, PClassActor *info)
{
while (info != NULL)
{

View file

@ -74,7 +74,7 @@ void ATeleportFog::PostBeginPlay ()
void P_SpawnTeleportFog(fixed_t x, fixed_t y, fixed_t z, int spawnid)
{
const PClass *fog=NULL;
PClassActor *fog = NULL;
if (spawnid > 0 && spawnid < MAX_SPAWNABLES && SpawnableThings[spawnid] != NULL)
{

View file

@ -81,9 +81,9 @@ struct FSplashDef
FName Name;
FSoundID SmallSplashSound;
FSoundID NormalSplashSound;
const PClass *SmallSplash;
const PClass *SplashBase;
const PClass *SplashChunk;
PClassActor *SmallSplash;
PClassActor *SplashBase;
PClassActor *SplashChunk;
BYTE ChunkXVelShift;
BYTE ChunkYVelShift;
BYTE ChunkZVelShift;

View file

@ -798,7 +798,7 @@ void APlayerPawn::GiveDeathmatchInventory()
AKey *key = (AKey *)GetDefaultByType (PClass::m_Types[i]);
if (key->KeyNumber != 0)
{
key = static_cast<AKey *>(Spawn (PClass::m_Types[i], 0,0,0, NO_REPLACE));
key = static_cast<AKey *>(Spawn(static_cast<PClassActor *>(PClass::m_Types[i]), 0,0,0, NO_REPLACE));
if (!key->CallTryPickup (this))
{
key->Destroy ();

View file

@ -174,7 +174,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnsetFloat)
//
//==========================================================================
static void DoAttack (AActor *self, bool domelee, bool domissile,
int MeleeDamage, FSoundID MeleeSound, const PClass *MissileType,fixed_t MissileHeight)
int MeleeDamage, FSoundID MeleeSound, PClassActor *MissileType,fixed_t MissileHeight)
{
if (self->target == NULL) return;
@ -189,9 +189,9 @@ static void DoAttack (AActor *self, bool domelee, bool domissile,
else if (domissile && MissileType != NULL)
{
// This seemingly senseless code is needed for proper aiming.
self->z+=MissileHeight-32*FRACUNIT;
AActor * missile = P_SpawnMissileXYZ (self->x, self->y, self->z + 32*FRACUNIT, self, self->target, MissileType, false);
self->z-=MissileHeight-32*FRACUNIT;
self->z += MissileHeight - 32*FRACUNIT;
AActor *missile = P_SpawnMissileXYZ (self->x, self->y, self->z + 32*FRACUNIT, self, self->target, MissileType, false);
self->z -= MissileHeight - 32*FRACUNIT;
if (missile)
{