mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-03 02:30:53 +00:00
Update to ZDoom r1905:
- Added Gez's seeker missile submission. - Added Gez's thing activation submission. - added a NULL pointer check to fog spawning in unmorphing code. - fixed: frozen corpses need to be treated as solid by z-movement code. - fixed: AAmbientSound::Serialize was adjusting its timer value for savegames even when it was set to a 'don't check' value. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@539 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
a3df4aba14
commit
33a4058533
22 changed files with 398 additions and 225 deletions
123
src/p_map.cpp
123
src/p_map.cpp
|
@ -837,24 +837,13 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
|
|||
|
||||
// Check for MF6_BUMPSPECIAL
|
||||
// By default, only players can activate things by bumping into them
|
||||
if ((thing->flags6 & MF6_BUMPSPECIAL))
|
||||
if ((thing->flags6 & MF6_BUMPSPECIAL) && ((tm.thing->player != NULL)
|
||||
|| ((thing->activationtype & THINGSPEC_MonsterTrigger) && (tm.thing->flags3 & MF3_ISMONSTER))
|
||||
|| ((thing->activationtype & THINGSPEC_MissileTrigger) && (tm.thing->flags & MF_MISSILE))
|
||||
) && (level.maptime > thing->lastbump)) // Leave the bumper enough time to go away
|
||||
{
|
||||
if (((tm.thing->player != NULL)
|
||||
|| ((thing->activationtype & THINGSPEC_MonsterTrigger) && (thing->flags3 & MF3_ISMONSTER))
|
||||
|| ((thing->activationtype & THINGSPEC_MissileTrigger) && (thing->flags & MF_MISSILE))
|
||||
))
|
||||
{ // Target switching mechanism
|
||||
if (thing->activationtype & THINGSPEC_ThingTargets) thing->target = tm.thing;
|
||||
if (thing->activationtype & THINGSPEC_TriggerTargets) tm.thing->target = thing;
|
||||
// Run the special
|
||||
|
||||
int res = LineSpecials[thing->special] (NULL,
|
||||
((thing->activationtype & THINGSPEC_ThingActs) ? thing : tm.thing), // Who triggers?
|
||||
false, thing->args[0], thing->args[1], thing->args[2], thing->args[3], thing->args[4]);
|
||||
|
||||
if (thing->activationtype & THINGSPEC_ClearSpecial && res) thing->special = 0;
|
||||
|
||||
}
|
||||
if (P_ActivateThingSpecial(thing, tm.thing))
|
||||
thing->lastbump = level.maptime + TICRATE;
|
||||
}
|
||||
|
||||
// Check for skulls slamming into things
|
||||
|
@ -1441,10 +1430,15 @@ bool P_TestMobjZ (AActor *actor, bool quick, AActor **pOnmobj)
|
|||
{ // Can't hit thing
|
||||
continue;
|
||||
}
|
||||
if (thing->flags & (MF_SPECIAL|MF_NOCLIP|MF_CORPSE))
|
||||
{ // [RH] Corpses and specials and noclippers don't block moves
|
||||
if (thing->flags & (MF_SPECIAL|MF_NOCLIP))
|
||||
{ // [RH] Specials and noclippers don't block moves
|
||||
continue;
|
||||
}
|
||||
if (thing->flags & (MF_CORPSE))
|
||||
{ // Corpses need a few more checks
|
||||
if (!(actor->flags & MF_ICECORPSE))
|
||||
continue;
|
||||
}
|
||||
if (!(thing->flags4 & MF4_ACTLIKEBRIDGE) && (actor->flags & MF_SPECIAL))
|
||||
{ // [RH] Only bridges block pickup items
|
||||
continue;
|
||||
|
@ -3770,18 +3764,9 @@ bool P_UseTraverse(AActor *usething, fixed_t endx, fixed_t endy, bool &foundline
|
|||
// Check for puzzle item use or USESPECIAL flag
|
||||
// Extended to use the same activationtype mechanism as BUMPSPECIAL does
|
||||
if (in->d.thing->flags5 & MF5_USESPECIAL || in->d.thing->special == UsePuzzleItem)
|
||||
{ // Target switching mechanism
|
||||
if (in->d.thing->activationtype & THINGSPEC_ThingTargets) in->d.thing->target = usething;
|
||||
if (in->d.thing->activationtype & THINGSPEC_TriggerTargets) usething->target = in->d.thing;
|
||||
// Run the special
|
||||
if (LineSpecials[in->d.thing->special] (NULL, // Who triggers?
|
||||
((in->d.thing->activationtype & THINGSPEC_ThingActs) ? in->d.thing : usething), false,
|
||||
in->d.thing->args[0], in->d.thing->args[1], in->d.thing->args[2],
|
||||
in->d.thing->args[3], in->d.thing->args[4]))
|
||||
{
|
||||
if (in->d.thing->activationtype & THINGSPEC_ClearSpecial) in->d.thing->special = 0;
|
||||
{
|
||||
if (P_ActivateThingSpecial(in->d.thing, usething))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Dead things can't talk.
|
||||
if (in->d.thing->health <= 0)
|
||||
|
@ -4315,10 +4300,15 @@ void P_FindAboveIntersectors (AActor *actor)
|
|||
{ // Can't hit thing
|
||||
continue;
|
||||
}
|
||||
if (thing->flags & (MF_CORPSE|MF_SPECIAL))
|
||||
if (thing->flags & (MF_SPECIAL))
|
||||
{ // [RH] Corpses and specials don't block moves
|
||||
continue;
|
||||
}
|
||||
if (thing->flags & (MF_CORPSE))
|
||||
{ // Corpses need a few more checks
|
||||
if (!(actor->flags & MF_ICECORPSE))
|
||||
continue;
|
||||
}
|
||||
if (thing == actor)
|
||||
{ // Don't clip against self
|
||||
continue;
|
||||
|
@ -4364,10 +4354,15 @@ void P_FindBelowIntersectors (AActor *actor)
|
|||
{ // Can't hit thing
|
||||
continue;
|
||||
}
|
||||
if (thing->flags & (MF_CORPSE|MF_SPECIAL))
|
||||
if (thing->flags & (MF_SPECIAL))
|
||||
{ // [RH] Corpses and specials don't block moves
|
||||
continue;
|
||||
}
|
||||
if (thing->flags & (MF_CORPSE))
|
||||
{ // Corpses need a few more checks
|
||||
if (!(actor->flags & MF_ICECORPSE))
|
||||
continue;
|
||||
}
|
||||
if (thing == actor)
|
||||
{ // Don't clip against self
|
||||
continue;
|
||||
|
@ -5165,3 +5160,67 @@ static void SpawnDeepSplash (AActor *t1, const FTraceResults &trace, AActor *puf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// P_ActivateThingSpecial
|
||||
//
|
||||
// Handles the code for things activated by death, USESPECIAL or BUMPSPECIAL
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
bool P_ActivateThingSpecial(AActor * thing, AActor * trigger, bool death)
|
||||
{
|
||||
bool res = false;
|
||||
|
||||
// Target switching mechanism
|
||||
if (thing->activationtype & THINGSPEC_ThingTargets) thing->target = trigger;
|
||||
if (thing->activationtype & THINGSPEC_TriggerTargets) trigger->target = thing;
|
||||
|
||||
// State change mechanism. The thing needs to be not dead and to have at least one of the relevant flags
|
||||
if (!death && (thing->activationtype & (THINGSPEC_Activate|THINGSPEC_Deactivate|THINGSPEC_Switch)))
|
||||
{
|
||||
// If a switchable thing does not know whether it should be activated
|
||||
// or deactivated, the default is to activate it.
|
||||
if ((thing->activationtype & THINGSPEC_Switch)
|
||||
&& !(thing->activationtype & (THINGSPEC_Activate|THINGSPEC_Deactivate)))
|
||||
{
|
||||
thing->activationtype |= THINGSPEC_Activate;
|
||||
}
|
||||
// Can it be activated?
|
||||
if (thing->activationtype & THINGSPEC_Activate)
|
||||
{
|
||||
thing->activationtype &= ~THINGSPEC_Activate; // Clear flag
|
||||
if (thing->activationtype & THINGSPEC_Switch) // Set other flag if switching
|
||||
thing->activationtype |= THINGSPEC_Deactivate;
|
||||
thing->Activate(trigger);
|
||||
res = true;
|
||||
}
|
||||
// If not, can it be deactivated?
|
||||
else if (thing->activationtype & THINGSPEC_Deactivate)
|
||||
{
|
||||
thing->activationtype &= ~THINGSPEC_Deactivate; // Clear flag
|
||||
if (thing->activationtype & THINGSPEC_Switch) // Set other flag if switching
|
||||
thing->activationtype |= THINGSPEC_Activate;
|
||||
thing->Deactivate(trigger);
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Run the special, if any
|
||||
if (thing->special)
|
||||
{
|
||||
res = !! LineSpecials[thing->special] (NULL,
|
||||
// TriggerActs overrides the level flag, which only concerns thing activated by death
|
||||
(((death && level.flags & LEVEL_ACTOWNSPECIAL && !(thing->activationtype & THINGSPEC_TriggerActs))
|
||||
|| (thing->activationtype & THINGSPEC_ThingActs)) // Who triggers?
|
||||
? thing : trigger),
|
||||
false, thing->args[0], thing->args[1], thing->args[2], thing->args[3], thing->args[4]);
|
||||
|
||||
// Clears the special if it was run on thing's death or if flag is set.
|
||||
if (death || (thing->activationtype & THINGSPEC_ClearSpecial && res)) thing->special = 0;
|
||||
}
|
||||
|
||||
// Returns the result
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue