- Changed decorate replacement to be opt-in instead of opt-out. This allows for
greater flexibility in what can be replaced (replaced actors need not be ancestors
of actors that replace them) at the expense of not having universal actor
replacement. Instances where replacements work:
- Line specials that spawn things (Thing_Spawn and related)
- ACS spawning commands (SpawnSpot and the like)
- Spawning mapthings at level load time in P_SpawnMapThing()
- Spawning items off of dead dudes in P_DropItem()
- The A_SpawnItem decorate function
- The summon and summonfriend console commands
- ThingCount will count both original actors and their replacements as the same
things.
TBD: Should the ACS inventory functions use replacements too, or not?
SVN r249 (trunk)
This commit is contained in:
parent
56427d1b1c
commit
38a073626f
8 changed files with 52 additions and 26 deletions
|
|
@ -64,6 +64,10 @@ bool P_Thing_Spawn (int tid, int type, angle_t angle, bool fog, int newtid)
|
|||
if ( (kind = SpawnableThings[type]) == NULL)
|
||||
return false;
|
||||
|
||||
|
||||
// Handle decorate replacements.
|
||||
kind = kind->ActorInfo->GetReplacement()->Class;
|
||||
|
||||
if ((GetDefaultByType (kind)->flags3 & MF3_ISMONSTER) && (dmflags & DF_NO_MONSTERS))
|
||||
return false;
|
||||
|
||||
|
|
@ -176,10 +180,14 @@ bool P_Thing_Projectile (int tid, int type, const char * type_name, angle_t angl
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((kind = PClass::FindClass(type_name)) == NULL)
|
||||
if ((kind = PClass::FindClass(type_name)) == NULL || kind->ActorInfo == NULL)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Handle decorate replacements.
|
||||
kind = kind->ActorInfo->GetReplacement()->Class;
|
||||
|
||||
defflags3 = GetDefaultByType (kind)->flags3;
|
||||
if ((defflags3 & MF3_ISMONSTER) && (dmflags & DF_NO_MONSTERS))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue