From d4160f721111cbcf452d7052bd4724c91c55bd2b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 May 2006 23:55:17 +0000 Subject: [PATCH] May 7, 2006 (Changes by Graf Zahl) - Added a misc/secret sound definition for Heretic. - Fixed: Powered up weapons were not properly deselected when the level ended and their ready state was different from the main weapon's. - Made some improvements to A_CountdownArg. - Removed the 'Yes', 'No' and 'Greetings' state assignment commands. They haven't been documented and thus haven't been used at all so far. Therefore they don't need to be handled considering that they will go away anyway. - Changed the DECORATE state parser so that Stop can also be specified right after a label, in addition to goto. SVN r84 (trunk) --- docs/rh-log.txt | 11 +++++++++ src/g_game.cpp | 7 ++++++ src/g_shared/a_weapons.cpp | 2 +- src/thingdef.cpp | 48 ++++++++++++-------------------------- src/thingdef_codeptr.cpp | 13 ++++++++++- wadsrc/sndinfo.txt | 2 ++ 6 files changed, 48 insertions(+), 35 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index c77232543..0c4b4e05b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,14 @@ +May 7, 2006 (Changes by Graf Zahl) +- Added a misc/secret sound definition for Heretic. +- Fixed: Powered up weapons were not properly deselected when the level ended + and their ready state was different from the main weapon's. +- Made some improvements to A_CountdownArg. +- Removed the 'Yes', 'No' and 'Greetings' state assignment commands. They haven't + been documented and thus haven't been used at all so far. Therefore they don't + need to be handled considering that they will go away anyway. +- Changed the DECORATE state parser so that Stop can also be specified right after + a label, in addition to goto. + May 6, 2006 - Updated Italian strings that someone kindly e-mailed to me. - The CRT no longer detects any memory leaks when I run to the IWAD picker and quit. diff --git a/src/g_game.cpp b/src/g_game.cpp index 4311f3dbe..49042556b 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1042,6 +1042,13 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode) } item = next; } + if (p->ReadyWeapon != NULL && + p->ReadyWeapon->WeaponFlags&WIF_POWERED_UP && + p->PendingWeapon == p->ReadyWeapon->SisterWeapon) + { + // Unselect powered up weapons if the unpowered counterpart is pending + p->ReadyWeapon=p->PendingWeapon; + } p->mo->flags &= ~MF_SHADOW; // cancel invisibility p->mo->RenderStyle = STYLE_Normal; p->mo->alpha = FRACUNIT; diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index 5fc4d8791..8c1775290 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -481,7 +481,7 @@ void AWeapon::PostMorphWeapon () void AWeapon::EndPowerup () { - if (SisterWeapon != NULL) + if (SisterWeapon != NULL && WeaponFlags&WIF_POWERED_UP) { if (ReadyState != SisterWeapon->ReadyState) { diff --git a/src/thingdef.cpp b/src/thingdef.cpp index 149edb12f..4a7175f59 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -1400,7 +1400,7 @@ static void RetargetStatePointers (intptr_t count, const char *target, FState ** { if (*probe == (FState *)count) { - *probe = (FState *)strdup (target); + *probe = target == NULL? NULL : (FState *)strdup (target); } } } @@ -1476,12 +1476,20 @@ do_goto: SC_MustGetString(); } else if (SC_Compare("STOP")) { - if (!laststate) +do_stop: + if (laststate!=NULL) + { + laststate->NextState=(FState*)-1; + } + else if (lastlabel >=0) + { + RetargetStates (count+1, NULL, actor->Class, defaults); + } + else { SC_ScriptError("STOP before first state"); continue; } - laststate->NextState=(FState*)-1; } else if (SC_Compare("WAIT") || SC_Compare("FAIL")) { @@ -1525,6 +1533,10 @@ do_goto: SC_MustGetString(); { goto do_goto; } + else if (SC_Compare("Stop")) + { + goto do_stop; + } strncpy(statestring, sc_String, 255); SC_MustGetString (); } while (SC_Compare (":")); @@ -2609,33 +2621,6 @@ static void ActorHealState (AActor *defaults, Baggage &bag) defaults->HealState=CheckState (bag.CurrentState, bag.Info->Class); } -//========================================================================== -// -//========================================================================== -static void ActorYesState (AActor *defaults, Baggage &bag) -{ - StatePropertyIsDeprecated (bag.Info->Class->Name+1, "Yes"); - defaults->YesState=CheckState (bag.CurrentState, bag.Info->Class); -} - -//========================================================================== -// -//========================================================================== -static void ActorNoState (AActor *defaults, Baggage &bag) -{ - StatePropertyIsDeprecated (bag.Info->Class->Name+1, "No"); - defaults->NoState=CheckState (bag.CurrentState, bag.Info->Class); -} - -//========================================================================== -// -//========================================================================== -static void ActorGreetingsState (AActor *defaults, Baggage &bag) -{ - StatePropertyIsDeprecated (bag.Info->Class->Name+1, "Greetings"); - defaults->GreetingsState=CheckState (bag.CurrentState, bag.Info->Class); -} - //========================================================================== // //========================================================================== @@ -3502,7 +3487,6 @@ static const ActorProps props[] = { "fastspeed", ActorFastSpeed, RUNTIME_CLASS(AActor) }, { "game", ActorGame, RUNTIME_CLASS(AActor) }, { "gibhealth", ActorGibHealth, RUNTIME_CLASS(AActor) }, - { "greetings", ActorGreetingsState, RUNTIME_CLASS(AActor) }, { "heal", ActorHealState, RUNTIME_CLASS(AActor) }, { "health", ActorHealth, RUNTIME_CLASS(AActor) }, { "height", ActorHeight, RUNTIME_CLASS(AActor) }, @@ -3529,7 +3513,6 @@ static const ActorProps props[] = { "missileheight", ActorMissileHeight, RUNTIME_CLASS(AActor) }, { "missiletype", ActorMissileType, RUNTIME_CLASS(AActor) }, { "monster", ActorMonster, RUNTIME_CLASS(AActor) }, - { "no", ActorNoState, RUNTIME_CLASS(AActor) }, { "obituary", ActorObituary, RUNTIME_CLASS(AActor) }, { "pain", ActorPainState, RUNTIME_CLASS(AActor) }, { "painchance", ActorPainChance, RUNTIME_CLASS(AActor) }, @@ -3575,7 +3558,6 @@ static const ActorProps props[] = { "woundhealth", ActorWoundHealth, RUNTIME_CLASS(AActor) }, { "xdeath", ActorXDeathState, RUNTIME_CLASS(AActor) }, { "xscale", ActorXScale, RUNTIME_CLASS(AActor) }, - { "yes", ActorYesState, RUNTIME_CLASS(AActor) }, { "yscale", ActorYScale, RUNTIME_CLASS(AActor) }, // AWeapon:MinAmmo1 and 2 are never used so there is no point in adding them here! }; diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index ce2875607..af78e7abd 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -1550,7 +1550,18 @@ void A_CountdownArg(AActor * self) if (index<=0 || index>5) return; if (!self->args[index]--) { - self->SetState(self->DeathState); + if (self->flags&MF_MISSILE) + { + P_ExplodeMissile(self, NULL); + } + else if (self->flags&MF_SHOOTABLE) + { + P_DamageMobj (self, NULL, NULL, self->health, MOD_UNKNOWN); + } + else + { + self->SetState(self->DeathState); + } } } diff --git a/wadsrc/sndinfo.txt b/wadsrc/sndinfo.txt index 4d6c479e7..5914fa4db 100644 --- a/wadsrc/sndinfo.txt +++ b/wadsrc/sndinfo.txt @@ -782,6 +782,8 @@ menu/invalid plroof menu/dismiss dorcls menu/clear dorcls +misc/secret dssecret + $endif // ifheretic