diff --git a/src/actor.h b/src/actor.h index 1eda53028..bc65144da 100644 --- a/src/actor.h +++ b/src/actor.h @@ -739,7 +739,7 @@ public: AInventory *FindInventory (FName type, bool subclass = false); template T *FindInventory () { - return static_cast (FindInventory (RUNTIME_TEMPLATE_CLASS(T))); + return static_cast (FindInventory (RUNTIME_CLASS(T))); } // Adds one item of a particular type. Returns NULL if it could not be added. @@ -1512,7 +1512,7 @@ public: do { actor = FActorIterator::Next (); - } while (actor && !actor->IsKindOf (RUNTIME_TEMPLATE_CLASS(T))); + } while (actor && !actor->IsKindOf (RUNTIME_CLASS(T))); return static_cast(actor); } }; @@ -1563,12 +1563,12 @@ inline AActor *Spawn(FName type, const DVector3 &pos, replace_t allowreplacement template inline T *Spawn(const DVector3 &pos, replace_t allowreplacement) { - return static_cast(AActor::StaticSpawn(RUNTIME_TEMPLATE_CLASS(T), pos, allowreplacement)); + return static_cast(AActor::StaticSpawn(RUNTIME_CLASS(T), pos, allowreplacement)); } template inline T *Spawn() // for inventory items we do not need coordinates and replacement info. { - return static_cast(AActor::StaticSpawn(RUNTIME_TEMPLATE_CLASS(T), DVector3(0, 0, 0), NO_REPLACE)); + return static_cast(AActor::StaticSpawn(RUNTIME_CLASS(T), DVector3(0, 0, 0), NO_REPLACE)); } inline PClassActor *PClass::FindActor(FName name) diff --git a/src/dobject.h b/src/dobject.h index ee2bfb5af..d043dfada 100644 --- a/src/dobject.h +++ b/src/dobject.h @@ -84,8 +84,7 @@ class DPillar; class PClassActor; #define RUNTIME_CLASS_CASTLESS(cls) (cls::RegistrationInfo.MyClass) // Passed a native class name, returns a PClass representing that class -#define RUNTIME_CLASS(cls) ((cls::MetaClass *)RUNTIME_CLASS_CASTLESS(cls)) // Like above, but returns the true type of the meta object -#define RUNTIME_TEMPLATE_CLASS(cls) ((typename cls::MetaClass *)RUNTIME_CLASS_CASTLESS(cls)) // RUNTIME_CLASS, but works with templated parameters on GCC +#define RUNTIME_CLASS(cls) ((typename cls::MetaClass *)RUNTIME_CLASS_CASTLESS(cls)) // Like above, but returns the true type of the meta object #define NATIVE_TYPE(object) (object->StaticType()) // Passed an object, returns the type of the C++ class representing the object // Enumerations for the meta classes created by ClassReg::RegisterClass() diff --git a/src/dthinker.h b/src/dthinker.h index c7a768ae3..da7eced7d 100644 --- a/src/dthinker.h +++ b/src/dthinker.h @@ -134,10 +134,10 @@ protected: template class TThinkerIterator : public FThinkerIterator { public: - TThinkerIterator (int statnum=MAX_STATNUM+1) : FThinkerIterator (RUNTIME_TEMPLATE_CLASS(T), statnum) + TThinkerIterator (int statnum=MAX_STATNUM+1) : FThinkerIterator (RUNTIME_CLASS(T), statnum) { } - TThinkerIterator (int statnum, DThinker *prev) : FThinkerIterator (RUNTIME_TEMPLATE_CLASS(T), statnum, prev) + TThinkerIterator (int statnum, DThinker *prev) : FThinkerIterator (RUNTIME_CLASS(T), statnum, prev) { } TThinkerIterator (const PClass *subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(subclass, statnum)