diff --git a/docs/rh-log.txt b/docs/rh-log.txt index c5fef5bcc..48f7c947d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,20 @@ +October 5, 2007 (Changes by Graf Zahl) +- Fixed: Tne Imp's raise state sequence was wrong due to a typo. +- Fixed: The shotgun had spawn ID 21 instead of 27. +- Fixed: All 3 states in the DoomUnusedStates actor need to end with a 'stop'. + +October 3, 2007 (Changes by Graf Zahl) +- Fixed: The DECORATE TakeInventory functions didn't check the IF_KEEPDEPLETED + flag. + +September 29, 2007 (Changes by Graf Zahl) +- Fixed: ClearInventory should leave ammo in the inventory because it might be + referenced by undroppable weapons. +- Fixed: Several functions in a_artifacts.cpp were missing a check for a valid + owner. +- Fixed: sc_man counted lines wrong when ungetting strings but getting tokens + next. + September 27, 2007 (Changes by Graf Zahl) - Fixed: When I changed the scaling of textures to full fixed point precision I forgot to change the call that draws the automap marker numbers. diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 8d9cd8f73..5de1f7e4e 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -152,7 +152,7 @@ void APowerup::InitEffect () void APowerup::DoEffect () { - if (Owner == NULL) + if (Owner == NULL || Owner->player == NULL) { return; } @@ -1189,6 +1189,9 @@ fixed_t APowerSpeed ::GetSpeedFactor () void APowerSpeed::DoEffect () { Super::DoEffect (); + + if (Owner == NULL || Owner->player == NULL) + return; if (Owner->player->cheats & CF_PREDICTING) return; @@ -1308,8 +1311,11 @@ void APowerTargeter::PositionAccuracy () { player_t *player = Owner->player; - player->psprites[ps_targetleft].sx = (160-3)*FRACUNIT - ((100 - player->accuracy) << FRACBITS); - player->psprites[ps_targetright].sx = (160-3)*FRACUNIT + ((100 - player->accuracy) << FRACBITS); + if (player != NULL) + { + player->psprites[ps_targetleft].sx = (160-3)*FRACUNIT - ((100 - player->accuracy) << FRACBITS); + player->psprites[ps_targetright].sx = (160-3)*FRACUNIT + ((100 - player->accuracy) << FRACBITS); + } } // Frightener Powerup -------------------------------- @@ -1370,6 +1376,9 @@ void APowerTimeFreezer::InitEffect( ) { int ulIdx; + if (Owner== NULL || Owner->player == NULL) + return; + // When this powerup is in effect, pause the music. S_PauseSound( false ); @@ -1570,6 +1579,9 @@ END_DEFAULTS void APowerDrain::InitEffect( ) { + if (Owner== NULL || Owner->player == NULL) + return; + // Give the player the power to drain life from opponents when he damages them. Owner->player->cheats |= CF_DRAIN; } @@ -1605,6 +1617,9 @@ END_DEFAULTS void APowerRegeneration::InitEffect( ) { + if (Owner== NULL || Owner->player == NULL) + return; + // Give the player the power to regnerate lost life. Owner->player->cheats |= CF_REGENERATION; } @@ -1638,6 +1653,9 @@ END_DEFAULTS void APowerHighJump::InitEffect( ) { + if (Owner== NULL || Owner->player == NULL) + return; + // Give the player the power to jump much higher. Owner->player->cheats |= CF_HIGHJUMP; } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 4ec709539..ec35a4896 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -135,7 +135,14 @@ static void DoClearInv (AActor *actor) AInventory *next = inv->Inventory; if (!(inv->ItemFlags & IF_UNDROPPABLE)) { - inv->Destroy (); + // Fix for undroppable weapons. Is this ok? + if (inv->IsKindOf(RUNTIME_CLASS(AAmmo))) + { + AAmmo *ammo = static_cast(inv); + ammo->Amount = 0; + } + else + inv->Destroy (); } else if (inv->GetClass() == RUNTIME_CLASS(AHexenArmor)) { diff --git a/src/sc_man.cpp b/src/sc_man.cpp index db6094d29..b309e9be3 100644 --- a/src/sc_man.cpp +++ b/src/sc_man.cpp @@ -73,8 +73,10 @@ static char StringBuffer[MAX_STRING_SIZE]; static bool ScriptOpen = false; static int ScriptSize; static bool AlreadyGot = false; +static int AlreadyGotLine; static bool LastGotToken = false; static char *LastGotPtr; +static int LastGotLine; static bool FreeScript = false; static char *SavedScriptPtr; static int SavedScriptLine; @@ -180,6 +182,7 @@ static void SC_PrepareScript (void) AlreadyGot = false; LastGotToken = false; LastGotPtr = NULL; + LastGotLine = 1; SavedScriptPtr = NULL; CMode = false; Escape = true; @@ -299,6 +302,7 @@ static bool SC_ScanString (bool tokens) return true; } ScriptPtr = LastGotPtr; + sc_Line = LastGotLine; } sc_Crossed = false; @@ -309,6 +313,7 @@ static bool SC_ScanString (bool tokens) } LastGotPtr = ScriptPtr; + LastGotLine = sc_Line; // In case the generated scanner does not use marker, avoid compiler warnings. marker; @@ -644,6 +649,7 @@ void SC_MustGetFloat (void) void SC_UnGet (void) { AlreadyGot = true; + AlreadyGotLine = LastGotLine; // in case of an error we want the line of the last token. } //========================================================================== @@ -912,7 +918,7 @@ void STACK_ARGS SC_ScriptError (const char *message, ...) } I_Error ("Script error, \"%s\" line %d:\n%s\n", ScriptName.GetChars(), - sc_Line, composed.GetChars()); + AlreadyGot? AlreadyGotLine : sc_Line, composed.GetChars()); } //========================================================================== diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index 65b7d426c..2a230b249 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -1303,7 +1303,7 @@ void DoTakeInventory(AActor * self, AActor * receiver) if (inv->Amount > 0 && pStateCall != NULL) pStateCall->Result=true; if (!amount || amount>=inv->Amount) { - if (inv->IsKindOf(RUNTIME_CLASS(AAmmo))) inv->Amount=0; + if (inv->ItemFlags&IF_KEEPDEPLETED) inv->Amount=0; else inv->Destroy(); } else inv->Amount-=amount; diff --git a/wadsrc/decorate/doom/doomimp.txt b/wadsrc/decorate/doom/doomimp.txt index ca56e5b42..d91227484 100644 --- a/wadsrc/decorate/doom/doomimp.txt +++ b/wadsrc/decorate/doom/doomimp.txt @@ -54,8 +54,7 @@ ACTOR DoomImp 3001 TROO U -1 Stop Raise: - TROO M 8 - TROO KLJI 8 + TROO MLKJI 8 Goto See } } diff --git a/wadsrc/decorate/doom/doommisc.txt b/wadsrc/decorate/doom/doommisc.txt index 164a50aa9..fa643fd28 100644 --- a/wadsrc/decorate/doom/doommisc.txt +++ b/wadsrc/decorate/doom/doommisc.txt @@ -70,8 +70,11 @@ ACTOR DoomUnusedStates States { SMT2 A -1 + stop Death: PLAY N -1 + stop PLAY S -1 + stop } } diff --git a/wadsrc/decorate/doom/doomweapons.txt b/wadsrc/decorate/doom/doomweapons.txt index e7bcbf63c..89f35c8b6 100644 --- a/wadsrc/decorate/doom/doomweapons.txt +++ b/wadsrc/decorate/doom/doomweapons.txt @@ -137,7 +137,7 @@ ACTOR Chainsaw : Weapon 2005 ACTOR Shotgun : DoomWeapon 2001 { Game Doom - SpawnID 21 + SpawnID 27 Weapon.SelectionOrder 1300 Weapon.AmmoUse 1 Weapon.AmmoGive 8