From 2829361c5c289d28fe3f65ea810464724a248a15 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 12 Jul 2007 15:15:57 +0000 Subject: [PATCH] - Added DTA_TopOffset and DTA_LeftOffset values to the automap background drawer. - Fixed: DECORATE color translations with explicit colors didn't work because the code treated byte values as fixed point. - Fixed: LEVEL_NOALLIES must clear MF_FRIENDLY off any spawned actor except players. Otherwise it doesn't work properly. - Fixed: Entering a backslash in the player's name box caused a crash because the code analyzing the string was missing a NULL pointer check. - Fixed: Thing_Hate and Teleport_ZombieChanger unconditionally made state jumps, even for dead monsters. - Fixed: The palette flash for item pickup was not reset upon a player's death. - Fixed: P_DamageMobj tried to get damage multiplier information from the damage inflictor, not the attacker. - Fixed: PowerTimeFreezer::DoEffect did not call its superclass method. - fixed: When morphed monsters died they tried to set MF3_STAYMORPHED for the attacker, not themselves. This caused a crash when they were killed by a crusher. SVN r539 (trunk) --- Makefile.linux | 2 +- docs/rh-log.txt | 17 +++++++++++++++++ src/am_map.cpp | 2 +- src/d_netinfo.cpp | 2 +- src/g_shared/a_artifacts.cpp | 1 + src/g_shared/a_morph.cpp | 2 +- src/p_interaction.cpp | 14 +++++++------- src/p_lnspec.cpp | 4 ++-- src/p_mobj.cpp | 4 ++++ src/p_user.cpp | 2 ++ src/sdl/i_main.cpp | 2 ++ src/thingdef/thingdef_properties.cpp | 6 ++++++ 12 files changed, 45 insertions(+), 13 deletions(-) diff --git a/Makefile.linux b/Makefile.linux index 6bb9281e6..080057c25 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -19,7 +19,7 @@ CFLAGS += -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DNEED_STRUPR LDFLAGS += -lFLAC++ -lFLAC -lz -ljpeg -lfmod `sdl-config --libs` `pkg-config gtk+-2.0 --libs` NASMFLAGS += -f elf -DM_TARGET_LINUX -SRCDIRS = src/ $(addprefix src/,g_doom/ g_heretic/ g_hexen/ g_raven/ g_shared/ g_strife/ oplsynth/ sound/ sdl/ textures/ ) +SRCDIRS = src/ $(addprefix src/,g_doom/ g_heretic/ g_hexen/ g_raven/ g_shared/ g_strife/ oplsynth/ sound/ sdl/ textures/ thingdef/) VPATH = $(SRCDIRS) INCLUDES = $(addprefix -I,$(SRCDIRS)) CFLAGS += $(INCLUDES) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 333a722c9..0e9a9b5c4 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,20 @@ +July 12, 2007 (Changes by Graf Zahl) +- Added DTA_TopOffset and DTA_LeftOffset values to the automap background drawer. +- Fixed: DECORATE color translations with explicit colors didn't work because the + code treated byte values as fixed point. +- Fixed: LEVEL_NOALLIES must clear MF_FRIENDLY off any spawned actor except players. + Otherwise it doesn't work properly. +- Fixed: Entering a backslash in the player's name box caused a crash because + the code analyzing the string was missing a NULL pointer check. +- Fixed: Thing_Hate and Teleport_ZombieChanger unconditionally made state jumps, + even for dead monsters. +- Fixed: The palette flash for item pickup was not reset upon a player's death. +- Fixed: P_DamageMobj tried to get damage multiplier information from the + damage inflictor, not the attacker. +- Fixed: PowerTimeFreezer::DoEffect did not call its superclass method. +- fixed: When morphed monsters died they tried to set MF3_STAYMORPHED for the + attacker, not themselves. This caused a crash when they were killed by a crusher. + May 28, 2007 (Changes by Graf Zahl) - Split thingdef.cpp into several files so that the state and property code no longer gets in the way of the main parser. diff --git a/src/am_map.cpp b/src/am_map.cpp index 852a3763d..8427fe30e 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -1108,7 +1108,7 @@ void AM_clearFB (int color) { for (x = mapxstart >> MAPBITS; x < f_w; x += pwidth) { - screen->DrawTexture (mapback, x, y, DTA_ClipBottom, f_h, TAG_DONE); + screen->DrawTexture (mapback, x, y, DTA_ClipBottom, f_h, DTA_TopOffset, 0, DTA_LeftOffset, 0, TAG_DONE); } } } diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 99b09600e..c567d517d 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -589,7 +589,7 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update) value = ptr; infotype++; } - else + else if (breakpt != NULL) { value = breakpt + 1; if ( (breakpt = strchr (value, '\\')) ) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 441f2b52c..8d9cd8f73 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -1398,6 +1398,7 @@ void APowerTimeFreezer::InitEffect( ) void APowerTimeFreezer::DoEffect( ) { + Super::DoEffect(); if ( EffectTics > 4*32 || (( EffectTics > 3*32 && EffectTics <= 4*32 ) && EffectTics % 16 != 0 ) || (( EffectTics > 2*32 && EffectTics <= 3*32 ) && EffectTics % 8 != 0 ) diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index a1ce4902c..3837a0af2 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -375,7 +375,7 @@ void AMorphedMonster::Destroy () void AMorphedMonster::Die (AActor *source, AActor *inflictor) { // Dead things don't unmorph - source->flags3 |= MF3_STAYMORPHED; + flags3 |= MF3_STAYMORPHED; Super::Die (source, inflictor); if (UnmorphedMe != NULL && (UnmorphedMe->flags & MF_UNMORPHED)) { diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 1173744ae..be23cda3e 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -892,13 +892,13 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage return; } - // Handle active damage modifiers (e.g. PowerDamage) - if (inflictor->Inventory != NULL) - { - int olddam = damage; - inflictor->Inventory->ModifyDamage(olddam, mod, damage, false); - if (olddam != damage && damage <= 0) return; - } + } + // Handle active damage modifiers (e.g. PowerDamage) + if (source != NULL && source->Inventory != NULL) + { + int olddam = damage; + source->Inventory->ModifyDamage(olddam, mod, damage, false); + if (olddam != damage && damage <= 0) return; } // Handle passive damage modifiers (e.g. PowerProtection) if (target->Inventory != NULL) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 62c490f8d..f9de8f2f7 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -773,7 +773,7 @@ FUNC(LS_Teleport_ZombieChanger) if (it != NULL) { EV_Teleport (arg0, arg1, ln, backSide, it, false, false, false); - it->SetState (it->FindState(NAME_Pain)); + if (it->health >= 0) it->SetState (it->FindState(NAME_Pain)); return true; } return false; @@ -1286,7 +1286,7 @@ FUNC(LS_Thing_Hate) hater->target = hatee; if (!(hater->flags2 & MF2_DORMANT)) { - hater->SetState (hater->SeeState); + if (hater->health > 0) hater->SetState (hater->SeeState); } } } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 1c3fd225e..ea7799fb2 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3220,6 +3220,10 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t return NULL; } } + if (level.flags & LEVEL_NOALLIES && !actor->player) + { + actor->flags &= ~MF_FRIENDLY; + } // [RH] Count monsters whenever they are spawned. if (actor->CountsAsKill()) { diff --git a/src/p_user.cpp b/src/p_user.cpp index 784db0f4a..b531047da 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -1035,6 +1035,8 @@ void APlayerPawn::Die (AActor *source, AActor *inflictor) { Super::Die (source, inflictor); + if (player != NULL && player->mo == this) player->bonuscount = 0; + if (player != NULL && player->mo != this) { // Make the real player die, too player->mo->Die (source, inflictor); diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index 6e57db2b0..20d67c0b6 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -194,6 +194,8 @@ int main (int argc, char **argv) GtkAvailable = gtk_init_check (&argc, &argv); + setlocale (LC_ALL, "C"); + if (SDL_Init (SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) == -1) { fprintf (stderr, "Could not initialize SDL:\n%s\n", SDL_GetError()); diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index bc050c932..2213073af 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -609,6 +609,12 @@ static void AddToTranslation(unsigned char * translation, char * range) gs = g2 - g1; bs = b2 - b1; } + r <<= FRACBITS; + g <<= FRACBITS; + b <<= FRACBITS; + rs <<= FRACBITS; + gs <<= FRACBITS; + bs <<= FRACBITS; if (start == end) { translation[start] = ColorMatcher.Pick