From 34c67b9eaef1cacecc20c5140c05a54d54d42d46 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 May 2016 00:00:27 +0200 Subject: [PATCH 1/4] - fixed: The NoiseList array was not cleared before use. --- src/p_enemy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 227c1ab480..b7ad540957 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -255,6 +255,7 @@ void P_NoiseAlert (AActor *target, AActor *emitter, bool splash, double maxdist) return; validcount++; + NoiseList.Clear(); NoiseMarkSector(emitter->Sector, target, splash, emitter, 0, maxdist); for (unsigned i = 0; i < NoiseList.Size(); i++) { From 19003a7973e116e76af0b234a111c30d18e2cfda Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 May 2016 09:38:33 +0200 Subject: [PATCH 2/4] - fixed: The node builder's FindMapBounds function included all vertices generated by the node builder. This could cause problems on maps with bogus nodes so it's better to only check vertices that are referenced by a linedef. --- src/nodebuild_utility.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/nodebuild_utility.cpp b/src/nodebuild_utility.cpp index f25d747dba..02e280261d 100644 --- a/src/nodebuild_utility.cpp +++ b/src/nodebuild_utility.cpp @@ -616,12 +616,16 @@ void FNodeBuilder::FLevel::FindMapBounds() minx = maxx = Vertices[0].fX(); miny = maxy = Vertices[0].fY(); - for (int i = 1; i < NumVertices; ++i) + for (int i = 1; i < NumLines; ++i) { - if (Vertices[i].fX() < minx) minx = Vertices[i].fX(); - else if (Vertices[i].fX() > maxx) maxx = Vertices[i].fX(); - if (Vertices[i].fY() < miny) miny = Vertices[i].fY(); - else if (Vertices[i].fY() > maxy) maxy = Vertices[i].fY(); + for (int j = 0; j < 2; j++) + { + vertex_t *v = (j == 0 ? Lines[i].v1 : Lines[i].v2); + if (v->fX() < minx) minx = v->fX(); + else if (v->fX() > maxx) maxx = v->fX(); + if (v->fY() < miny) miny = v->fY(); + else if (v->fY() > maxy) maxy = v->fY(); + } } MinX = FLOAT2FIXED(minx); From b926cf35d5d3c3b642771e2ab8c15ca764b2f46f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 May 2016 09:45:17 +0200 Subject: [PATCH 3/4] - fixed: The portal init code should only delete REJECT if there's actually some portals to consider. --- src/portal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/portal.cpp b/src/portal.cpp index 74d97b6e74..41f2e755e1 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -1111,7 +1111,7 @@ void P_CreateLinkedPortals() } // reject would just get in the way when checking sight through portals. - if (rejectmatrix != NULL) + if (Displacements.size > 1 && rejectmatrix != NULL) { delete[] rejectmatrix; rejectmatrix = NULL; From d43ea330311fae10bd264ba6d97320eac0ac3782 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 27 May 2016 11:39:44 +0200 Subject: [PATCH 4/4] - fixed: A_CustomBulletAttack may not rely on the parameter default setter to get a valid puff. This must be checked explicitly in the functions body to ensure it is never NULL. --- src/thingdef/thingdef_codeptr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index feec1aceb6..86de07b5da 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1463,7 +1463,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack) PARAM_ANGLE (spread_z); PARAM_INT (numbullets); PARAM_INT (damageperbullet); - PARAM_CLASS_OPT (pufftype, AActor) { pufftype = PClass::FindActor(NAME_BulletPuff); } + PARAM_CLASS_OPT (pufftype, AActor) { pufftype = nullptr; } PARAM_FLOAT_OPT (range) { range = 0; } PARAM_INT_OPT (flags) { flags = 0; } PARAM_INT_OPT (ptr) { ptr = AAPTR_TARGET; } @@ -1487,6 +1487,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomBulletAttack) bangle = self->Angles.Yaw; if (!(flags & CBAF_NOPITCH)) bslope = P_AimLineAttack (self, bangle, MISSILERANGE); + if (pufftype == nullptr) pufftype = PClass::FindActor(NAME_BulletPuff); S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM); for (i = 0; i < numbullets; i++)