- removed the limit of 64 on-state switches from the init code.

No other place in the engine needs this, it was just the chosen size for a local check array.
This commit is contained in:
Christoph Oelckers 2022-12-03 20:30:49 +01:00
parent ba3e8a9842
commit 8e17f1f0f5
3 changed files with 9 additions and 24 deletions

View file

@ -40,9 +40,8 @@ BEGIN_DUKE_NS
void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac)
{
DAngle kang;
int k, p;
int l, t1, t3, t4;
int t1, t3, t4;
tspritetype* t;
DDukeActor* h;

View file

@ -268,7 +268,7 @@ void spriteinit_d(DDukeActor* actor, TArray<DDukeActor*>& actors)
void prelevel_d(int g, TArray<DDukeActor*>& actors)
{
int i, j, lotaglist;
short lotags[65];
TArray<short> lotags;
prelevel_common(g);
@ -324,17 +324,10 @@ void prelevel_d(int g, TArray<DDukeActor*>& actors)
case POWERSWITCH1ON:
case LOCKSWITCH1ON:
case POWERSWITCH2ON:
for (j = 0; j < lotaglist; j++)
if (actor->spr.lotag == lotags[j])
break;
if (j == lotaglist)
j = lotags.Find(actor->spr.lotag);
if (j == lotags.Size())
{
lotags[lotaglist] = actor->spr.lotag;
lotaglist++;
if (lotaglist > 64)
I_Error("Too many switches (64 max).");
lotags.Push(actor->spr.lotag);
DukeStatIterator it1(STAT_EFFECTOR);
while (auto ac = it1.Next())
{

View file

@ -409,7 +409,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
int i;
int j;
int lotaglist;
short lotags[65];
TArray<short> lotags;
int speed = 0;
int dist;
int sound;
@ -631,17 +631,10 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
case CHICKENPLANTBUTTON:
case CHICKENPLANTBUTTONON:
for (j = 0; j < lotaglist; j++)
if (ac->spr.lotag == lotags[j])
break;
if (j == lotaglist)
j = lotags.Find(ac->spr.lotag);
if (j == lotags.Size())
{
lotags[lotaglist] = ac->spr.lotag;
lotaglist++;
if (lotaglist > 64)
I_Error("Too many switches (64 max).");
lotags.Push(ac->spr.lotag);
DukeStatIterator it1(STAT_EFFECTOR);
while (auto actj = it1.Next())
{