diff --git a/src/nodebuild_utility.cpp b/src/nodebuild_utility.cpp index f25d747db..02e280261 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); diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 227c1ab48..b7ad54095 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++) { diff --git a/src/portal.cpp b/src/portal.cpp index 74d97b6e7..41f2e755e 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; diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index feec1aceb..86de07b5d 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++)