diff --git a/docs/rh-log.txt b/docs/rh-log.txt index d2567c9dc..c0396b4ff 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,9 @@ -July 12, 2009 (Changes by Graf Zahl) +July 13, 2009 (Changes by Graf Zahl) +- added submission for raising master/children/siblings. +- added submission for no decals on wall option. +- removed some useless code from SpawnMissile function. + +July 12, 2009 (Changes by Graf Zahl) - Backported 2 fixes from Skulltag: * A_SentinelAttack must check for a NULL target * Monsters with CANTLEAVEFLOORPIC could not move because their floor diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 2326b4775..420c1a3f1 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -130,6 +130,7 @@ Note: All fields default to false unless mentioned otherwise. smoothlighting = ; // Use smooth fake contrast. clipmidtex = ; // Side's mid textures are clipped to floor and ceiling. wrapmidtex = ; // Side's mid textures are wrapped. + nodecals = ; // Disables decals on the sidedef. } sector diff --git a/src/namedef.h b/src/namedef.h index e37c28728..8564d7036 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -301,6 +301,7 @@ xx(Heightceiling) xx(Lightlevel) xx(Texturefloor) xx(Textureceiling) +xx(Nodecals) xx(Skill1) xx(Skill2) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 452d5c930..79cc49e29 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1369,60 +1369,6 @@ FUNC(LS_Thing_SpawnFacing) return P_Thing_Spawn (arg0, it, arg1, ANGLE_MAX, arg2 ? false : true, arg3); } -static bool DoThingRaise(AActor *thing) -{ - if (thing == NULL) - return false; // not valid - - if (!(thing->flags & MF_CORPSE) ) - return true; // not a corpse - - if (thing->tics != -1) - return true; // not lying still yet - - FState * RaiseState = thing->FindState(NAME_Raise); - if (RaiseState == NULL) - return true; // monster doesn't have a raise state - - AActor *info = thing->GetDefault (); - - thing->velx = thing->vely = 0; - - // [RH] Check against real height and radius - fixed_t oldheight = thing->height; - fixed_t oldradius = thing->radius; - int oldflags = thing->flags; - - thing->flags |= MF_SOLID; - thing->height = info->height; // [RH] Use real height - thing->radius = info->radius; // [RH] Use real radius - if (!P_CheckPosition (thing, thing->x, thing->y)) - { - thing->flags = oldflags; - thing->radius = oldradius; - thing->height = oldheight; - return false; - } - - S_Sound (thing, CHAN_BODY, "vile/raise", 1, ATTN_IDLE); - - thing->SetState (RaiseState); - thing->flags = info->flags; - thing->flags2 = info->flags2; - thing->flags3 = info->flags3; - thing->flags4 = info->flags4; - thing->health = info->health; - thing->target = NULL; - thing->lastenemy = NULL; - - // [RH] If it's a monster, it gets to count as another kill - if (thing->CountsAsKill()) - { - level.total_monsters++; - } - return true; -} - FUNC(LS_Thing_Raise) // Thing_Raise(tid) { @@ -1431,7 +1377,7 @@ FUNC(LS_Thing_Raise) if (arg0==0) { - ok = DoThingRaise (it); + ok = P_Thing_Raise (it); } else { @@ -1439,7 +1385,7 @@ FUNC(LS_Thing_Raise) while ( (target = iterator.Next ()) ) { - ok |= DoThingRaise(target); + ok |= P_Thing_Raise(target); } } return ok; diff --git a/src/p_local.h b/src/p_local.h index d0b2432d6..75f0c2bff 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -140,6 +140,7 @@ bool P_MoveThing(AActor *source, fixed_t x, fixed_t y, fixed_t z, bool fog); bool P_Thing_Move (int tid, AActor *source, int mapspot, bool fog); int P_Thing_Damage (int tid, AActor *whofor0, int amount, FName type); void P_RemoveThing(AActor * actor); +bool P_Thing_Raise(AActor *thing); // // P_ENEMY diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 5247bae60..ed81dbc2d 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4796,26 +4796,6 @@ static fixed_t GetDefaultSpeed(const PClass *type) return GetDefaultByType(type)->Speed; } -static AActor * SpawnMissile (const PClass *type, fixed_t x, fixed_t y, fixed_t z) -{ - AActor *th = Spawn (type, x, y, z, ALLOW_REPLACE); - - if (th != NULL) - { - // Force floor huggers to the floor and ceiling huggers to the ceiling - if (th->flags3 & MF3_FLOORHUGGER) - { - z = th->floorz; - } - else if (th->flags3 & MF3_CEILINGHUGGER) - { - z = th->ceilingz - th->height; - } - } - return th; -} - - //--------------------------------------------------------------------------- // // FUNC P_SpawnMissile @@ -4851,7 +4831,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, z -= source->floorclip; } - AActor *th = SpawnMissile (type, x, y, z); + AActor *th = Spawn (type, x, y, z, ALLOW_REPLACE); P_PlaySpawnSound(th, source); th->target = source; // record missile's originator @@ -4966,7 +4946,7 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, z -= source->floorclip; } - mo = SpawnMissile (type, source->x, source->y, z); + mo = Spawn (type, source->x, source->y, z, ALLOW_REPLACE); P_PlaySpawnSound(mo, source); mo->target = owner != NULL ? owner : source; // Originator diff --git a/src/p_things.cpp b/src/p_things.cpp index 497412e25..2d5ebd558 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -424,6 +424,60 @@ void P_RemoveThing(AActor * actor) } } +bool P_Thing_Raise(AActor *thing) +{ + if (thing == NULL) + return false; // not valid + + if (!(thing->flags & MF_CORPSE) ) + return true; // not a corpse + + if (thing->tics != -1) + return true; // not lying still yet + + FState * RaiseState = thing->FindState(NAME_Raise); + if (RaiseState == NULL) + return true; // monster doesn't have a raise state + + AActor *info = thing->GetDefault (); + + thing->velx = thing->vely = 0; + + // [RH] Check against real height and radius + fixed_t oldheight = thing->height; + fixed_t oldradius = thing->radius; + int oldflags = thing->flags; + + thing->flags |= MF_SOLID; + thing->height = info->height; // [RH] Use real height + thing->radius = info->radius; // [RH] Use real radius + if (!P_CheckPosition (thing, thing->x, thing->y)) + { + thing->flags = oldflags; + thing->radius = oldradius; + thing->height = oldheight; + return false; + } + + S_Sound (thing, CHAN_BODY, "vile/raise", 1, ATTN_IDLE); + + thing->SetState (RaiseState); + thing->flags = info->flags; + thing->flags2 = info->flags2; + thing->flags3 = info->flags3; + thing->flags4 = info->flags4; + thing->health = info->health; + thing->target = NULL; + thing->lastenemy = NULL; + + // [RH] If it's a monster, it gets to count as another kill + if (thing->CountsAsKill()) + { + level.total_monsters++; + } + return true; +} + CCMD (dumpspawnables) { diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index dfc1adb9d..c7fc0b80f 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -973,6 +973,10 @@ struct UDMFParser Flag(sd->Flags, WALLF_CLIP_MIDTEX, key); continue; + case NAME_Nodecals: + Flag(sd->Flags, WALLF_NOAUTODECALS, key); + continue; + default: break; diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 74d1bfc29..52de61485 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -2549,6 +2549,78 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveChildren) } } +//=========================================================================== +// +// A_RemoveSiblings +// +//=========================================================================== +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveSiblings) +{ + TThinkerIterator it; + AActor * mo; + ACTION_PARAM_START(1); + ACTION_PARAM_BOOL(removeall,0); + + while ( (mo = it.Next()) ) + { + if ( ( mo->master == self->master ) && ( mo != self ) && ( ( mo->health <= 0 ) || removeall) ) + { + P_RemoveThing(mo); + } + } +} + +//=========================================================================== +// +// A_RaiseMaster +// +//=========================================================================== +DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster) +{ + if (self->master != NULL) + { + P_Thing_Raise(self->master); + } +} + +//=========================================================================== +// +// A_RaiseChildren +// +//=========================================================================== +DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren) +{ + TThinkerIterator it; + AActor * mo; + + while (mo = it.Next()) + { + if ( mo->master == self ) + { + P_Thing_Raise(mo); + } + } +} + +//=========================================================================== +// +// A_RaiseSiblings +// +//=========================================================================== +DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings) +{ + TThinkerIterator it; + AActor * mo; + + while ( (mo = it.Next()) ) + { + if ( ( mo->master == self->master ) && ( mo != self ) ) + { + P_Thing_Raise(mo); + } + } +} + //=========================================================================== // // A_MonsterRefire diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index decdfa72b..425863b75 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -197,9 +197,13 @@ ACTOR Actor native //: Thinker action native A_JumpIf(bool expression, state label); action native A_RemoveMaster(); action native A_RemoveChildren(bool removeall = false); + action native A_RemoveSiblings(bool removeall = false); action native A_KillMaster(); action native A_KillChildren(); action native A_KillSiblings(); + action native A_RaiseMaster(); + action native A_RaiseChildren(); + action native A_RaiseSiblings(); action native A_CheckFloor(state label); action native A_CheckCeiling(state label); action native A_PlayerSkinCheck(state label); diff --git a/wadsrc/static/actors/heretic/hereticweaps.txt b/wadsrc/static/actors/heretic/hereticweaps.txt index e78a1453d..93f1f56fb 100644 --- a/wadsrc/static/actors/heretic/hereticweaps.txt +++ b/wadsrc/static/actors/heretic/hereticweaps.txt @@ -633,6 +633,7 @@ ACTOR MaceFX4 native -NOGRAVITY +TELESTOMP +THRUGHOST + -NOTELEPORT BounceType "HereticCompat" SeeSound ""