diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 8c340565..dbb438ae 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,11 @@ +August 12, 2008 (Changes by Graf Zahl) +- fixed: A_CallSpecial must be declared in DECORATE so that a symbol table + entry can be generated for it. +- fixed: Dehacked replaced pickups multiple times for changing its states. +- fixed: Dehacked must copy AInventory's state to any item it hacks to be a + pickup. +- fixed a few more DECORATE bugs. + August 12, 2008 (Changes by Graf Zahl) - Fixed: The chat sound for Strife was misnamed in the gameinfo structure. - fixed a few DECORATE bugs. diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 2b26e8f1..67f5cce5 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -346,6 +346,15 @@ static bool ReadChars (char **stuff, int size); static char *igets (void); static int GetLine (void); +static void PushTouchedActor(PClass *cls) +{ + for(unsigned i = 0; i < TouchedActors.Size(); i++) + { + if (TouchedActors[i] == cls) return; + } + TouchedActors.Push(cls); +} + inline const char *GetName (int name) { return NameBase + NameOffs[name]; @@ -438,7 +447,8 @@ static FState *FindState (int statenum) { if (StateMap[i].OwnerIsPickup) { - TouchedActors.Push (const_cast(StateMap[i].Owner)); + + PushTouchedActor(const_cast(StateMap[i].Owner)); } return StateMap[i].State + statenum - stateacc; } @@ -1026,7 +1036,7 @@ static int PatchThing (int thingy) if (info->flags & MF_SPECIAL) { - TouchedActors.Push (const_cast(type)); + PushTouchedActor(const_cast(type)); } // Make MF3_ISMONSTER match MF_COUNTKILL @@ -2577,6 +2587,11 @@ void FinishDehPatch () // Make a copy the state labels MakeStateDefines(type->ActorInfo->StateList); + if (!type->IsDescendantOf(RUNTIME_CLASS(AInventory))) + { + // If this is a hacked non-inventory item we must also copy AInventory's special states + AddStateDefines(RUNTIME_CLASS(AInventory)->ActorInfo->StateList); + } InstallStates(subclass->ActorInfo, defaults2); // Use the DECORATE replacement feature to redirect all spawns @@ -2584,7 +2599,7 @@ void FinishDehPatch () type->ActorInfo->Replacement = subclass->ActorInfo; subclass->ActorInfo->Replacee = type->ActorInfo; - DPrintf ("%s replaces %s\n", subclass->TypeName.GetChars(), type->TypeName.GetChars()); + Printf ("%s replaces %s\n", subclass->TypeName.GetChars(), type->TypeName.GetChars()); } // Now that all Dehacked patches have been processed, it's okay to free StateMap. diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 14c7933c..3724be6e 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -837,6 +837,8 @@ void AInventory::Hide () } } + assert(HideDoomishState != NULL || HideSpecialState != NULL); + if (HideSpecialState != NULL) { SetState (HideSpecialState); @@ -848,11 +850,6 @@ void AInventory::Hide () SetState (HideDoomishState); tics = 1050; } - else - { - GoAwayAndDie(); - return; - } if (RespawnTics != 0) { tics = RespawnTics; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 2010281e..0ce28952 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -530,6 +530,7 @@ bool AActor::SetState (FState *newstate) newstate = newstate->GetNextState(); } while (tics == 0); + gl_SetActorLights(this); return true; } diff --git a/src/svnrevision.h b/src/svnrevision.h index eab4bb0f..36f6a29b 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "1165" -#define ZD_SVN_REVISION_NUMBER 1165 +#define ZD_SVN_REVISION_STRING "1167" +#define ZD_SVN_REVISION_NUMBER 1167 diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index 2425d74f..75151067 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -99,6 +99,7 @@ void AddState (const char * statename, FState * state); FState * FindState(AActor * actor, const PClass * type, const char * name); void InstallStates(FActorInfo *info, AActor *defaults); void MakeStateDefines(const FStateLabels *list); +void AddStateDefines(const FStateLabels *list); FState *P_GetState(AActor *self, FState *CallingState, int offset); int FinishStates (FScanner &sc, FActorInfo *actor, AActor *defaults, Baggage &bag); int ParseStates(FScanner &sc, FActorInfo *actor, AActor *defaults, Baggage &bag); diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index ba3babc9..9831a07f 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -67,8 +67,6 @@ static TArray StateArray; // //========================================================================== -DECLARE_ACTION(A_CallSpecial) - //========================================================================== // // Find a function by name using a binary search @@ -369,6 +367,24 @@ void MakeStateDefines(const FStateLabels *list) MakeStateList(list, StateLabels); } +void AddStateDefines(const FStateLabels *list) +{ + if (list != NULL) for(int i=0;iNumLabels;i++) + { + if (list->Labels[i].Children == NULL) + { + if (!FindStateLabelInList(StateLabels, list->Labels[i].Label, false)) + { + FStateDefine def; + + def.Label = list->Labels[i].Label; + def.State = list->Labels[i].State; + StateLabels.Push(def); + } + } + } +} + //========================================================================== // // PrepareStateParameters diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index d1866264..f3056eb6 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -74,6 +74,7 @@ ACTOR Actor native //: Thinker action native A_Die(name damagetype = "none"); action native A_Detonate(); action native A_Mushroom(class spawntype = "FatShot", int numspawns = 0); + action native A_CallSpecial(int special, int arg1=0, int arg2=0, int arg3=0, int arg4=0, int arg5=0); action native A_SetFloorClip(); action native A_UnSetFloorClip(); diff --git a/wadsrc/static/actors/hexen/hexenspecialdecs.txt b/wadsrc/static/actors/hexen/hexenspecialdecs.txt index 0758f94d..7d4a13a9 100644 --- a/wadsrc/static/actors/hexen/hexenspecialdecs.txt +++ b/wadsrc/static/actors/hexen/hexenspecialdecs.txt @@ -191,6 +191,7 @@ ACTOR BloodPool 111 ACTOR ZCorpseLynchedNoHeart 109 native { + Game Hexen Radius 10 Height 100 +SOLID +SPAWNCEILING +NOGRAVITY diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index 9de4d294..fcbafbac 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -37,7 +37,7 @@ ACTOR Inventory native action native A_ClearReFire(); action native A_CheckReload(); action native A_GunFlash(); - action native A_Saw(sound fullsound = "misc/sawfull", sound hitsound = "misc/sawhit", int damage = 2, class pufftype = "BulletPuff"); + action native A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class pufftype = "BulletPuff"); action native A_CheckForReload(int counter, state label); action native A_ResetReloadCounter(); action native A_RestoreSpecialPosition(); diff --git a/wadsrc/static/actors/strife/strifestuff.txt b/wadsrc/static/actors/strife/strifestuff.txt index 4516d91d..3f2aa952 100644 --- a/wadsrc/static/actors/strife/strifestuff.txt +++ b/wadsrc/static/actors/strife/strifestuff.txt @@ -467,7 +467,7 @@ ACTOR SStalagmiteSmall 163 States { Spawn: - STLG E -1 + STLG F -1 Stop } }