- unlimited blockingpairs

This commit is contained in:
Christoph Oelckers 2021-11-21 00:25:22 +01:00
parent 1665e340be
commit b30be9bc12
2 changed files with 8 additions and 5 deletions

View file

@ -41,7 +41,7 @@
#include "mapinfo.h" #include "mapinfo.h"
static TArray<usermaphack_t> usermaphacks; static TArray<usermaphack_t> usermaphacks;
TArray<int> blockingpairs[MAXWALLS]; TArray<TArray<int>> blockingpairs;
void AddUserMapHack(usermaphack_t& mhk) void AddUserMapHack(usermaphack_t& mhk)
{ {
@ -144,6 +144,10 @@ static int32_t LoadMapHack(const char *filename)
{ {
if (sc.CheckNumber() && validateWall()) if (sc.CheckNumber() && validateWall())
{ {
if (blockingpairs.Size() < (unsigned)numwalls)
{
blockingpairs.Resize(numwalls);
}
blockingpairs[currentwall].Push(sc.Number); blockingpairs[currentwall].Push(sc.Number);
} }
} }
@ -376,8 +380,8 @@ static int32_t LoadMapHack(const char *filename)
void G_LoadMapHack(const char* filename, const unsigned char* md4) void G_LoadMapHack(const char* filename, const unsigned char* md4)
{ {
hw_ClearSplitSector(); hw_ClearSplitSector();
blockingpairs.Reset();
for (auto& p : blockingpairs) p.Clear();
FString internal = "engine/compatibility/"; FString internal = "engine/compatibility/";
for (int j = 0; j < 16; ++j) for (int j = 0; j < 16; ++j)
{ {

View file

@ -45,8 +45,7 @@
#include "gamecontrol.h" #include "gamecontrol.h"
#include "hw_sections.h" #include "hw_sections.h"
extern TArray<int> blockingpairs[MAXWALLS]; extern TArray<TArray<int>> blockingpairs;
//========================================================================== //==========================================================================
// //
// //
@ -301,7 +300,7 @@ void BunchDrawer::ProcessBunch(int bnch)
int ww = sectionLines[i].wall; int ww = sectionLines[i].wall;
if (ww != -1) if (ww != -1)
{ {
for (auto p : blockingpairs[ww]) blockwall.Set(sectionLines[p].wall); if (blockingpairs.Size() > 0) for (auto p : blockingpairs[ww]) blockwall.Set(sectionLines[p].wall);
show2dwall.Set(ww); show2dwall.Set(ww);
if (!gotwall[i]) if (!gotwall[i])