From 79ff9ae3aef614ab7963d66698446b9c2306f5c7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Aug 2010 08:13:23 +0000 Subject: [PATCH] - fixed: FNodeBuilder::ExtractMini needs to check for segs that were created from minisegs. - made polyobject node building code more update friendly for GZDoom by making R_BuildPolyBSP public. SVN r2500 (trunk) --- src/g_shared/a_armor.cpp | 4 ++-- src/nodebuild_extract.cpp | 12 ++++++++++-- src/r_bsp.cpp | 2 +- src/r_bsp.h | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/g_shared/a_armor.cpp b/src/g_shared/a_armor.cpp index 6dd39885d0..6bed525d83 100644 --- a/src/g_shared/a_armor.cpp +++ b/src/g_shared/a_armor.cpp @@ -217,7 +217,7 @@ AInventory *ABasicArmorPickup::CreateCopy (AActor *other) copy->MaxFullAbsorb = MaxFullAbsorb; if (!(ItemFlags & IF_IGNORESKILL)) - { // extra ammo in baby mode and nightmare mode + { SaveAmount = FixedMul(SaveAmount, G_SkillProperty(SKILLP_ArmorFactor)); } @@ -300,7 +300,7 @@ AInventory *ABasicArmorBonus::CreateCopy (AActor *other) copy->MaxFullAbsorb = MaxFullAbsorb; if (!(ItemFlags & IF_IGNORESKILL)) - { // extra ammo in baby mode and nightmare mode + { SaveAmount = FixedMul(SaveAmount, G_SkillProperty(SKILLP_ArmorFactor)); } return copy; diff --git a/src/nodebuild_extract.cpp b/src/nodebuild_extract.cpp index 24fadcf3b4..d8675aa6eb 100644 --- a/src/nodebuild_extract.cpp +++ b/src/nodebuild_extract.cpp @@ -224,8 +224,16 @@ void FNodeBuilder::ExtractMini (FMiniBSP *bsp) out->v2 = &bsp->Verts[org->v2]; out->backsector = org->backsector; out->frontsector = org->frontsector; - out->linedef = Level.Lines + org->linedef; - out->sidedef = Level.Sides + org->sidedef; + if (org->sidedef != int(NO_SIDE)) + { + out->linedef = Level.Lines + org->linedef; + out->sidedef = Level.Sides + org->sidedef; + } + else // part of a miniseg + { + out->linedef = NULL; + out->sidedef = NULL; + } out->PartnerSeg = NULL; out->bPolySeg = false; } diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 8eebac3d53..71d4f210a5 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -1032,7 +1032,7 @@ FMiniBSP::FMiniBSP() // //========================================================================== -static void R_BuildPolyBSP(subsector_t *sub) +void R_BuildPolyBSP(subsector_t *sub) { assert((sub->BSP == NULL || sub->BSP->bDirty) && "BSP computed more than once"); diff --git a/src/r_bsp.h b/src/r_bsp.h index 5701647a7b..d8b00ec2ac 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -75,6 +75,7 @@ EXTERN_CVAR (Bool, r_drawflat) // [RH] Don't texture segs? // BSP? void R_ClearClipSegs (short left, short right); void R_ClearDrawSegs (); +void R_BuildPolyBSP(subsector_t *sub); void R_RenderBSPNode (void *node); // killough 4/13/98: fake floors/ceilings for deep water / fake ceilings: