- temporary fix event-related crashes

This commit is contained in:
InspirationByte 2022-02-07 23:49:37 +03:00
parent a5332be4ce
commit 743aa3dbe3

View File

@ -3421,22 +3421,6 @@ VECTOR* TriggerEvent(int i)
return NULL; return NULL;
} }
if (GameLevel >= 2 && i > 0 && i < 4) // Vegas and Rio detonators
{
if (stage[i] == 0)
{
ev = &firstMissionEvent[i - 1];
ev->next = firstEvent->next;
firstEvent->next = ev;
VisibilityLists(VIS_ADD, ev - event);
SetMSoundVar(i, NULL);
detonator.count++;
}
}
else
{ {
if (GameLevel == 0) if (GameLevel == 0)
{ {
@ -3613,6 +3597,25 @@ VECTOR* TriggerEvent(int i)
event[1].next = &event[2]; event[1].next = &event[2];
break; break;
case 1:
case 2:
case 3:
if (gCurrentMissionNumber == 30)
{
if (stage[i] == 0)
{
ev = &firstMissionEvent[i - 1];
ev->next = firstEvent->next;
firstEvent->next = ev;
VisibilityLists(VIS_ADD, ev - event);
SetMSoundVar(i, NULL);
detonator.count++;
}
}
break;
case 4: case 4:
TriggerDoor(&vegasDoor[i - 4], &stage[i], 0); TriggerDoor(&vegasDoor[i - 4], &stage[i], 0);
break; break;
@ -3622,7 +3625,7 @@ VECTOR* TriggerEvent(int i)
case 5: case 5:
case 6: case 6:
case 7: case 7:
TriggerDoor(&vegasDoor[i - 4], &stage[i], 1); TriggerDoor(&vegasDoor[i - 5], &stage[i], 1);
break; break;
case 9: case 9:
SetMSoundVar(5, NULL); SetMSoundVar(5, NULL);
@ -3635,6 +3638,25 @@ VECTOR* TriggerEvent(int i)
case 0: case 0:
event->timer = 1; event->timer = 1;
break; break;
case 1:
case 2:
case 3:
if (gCurrentMissionNumber == 30)
{
if (stage[i] == 0)
{
ev = &firstMissionEvent[i - 1];
ev->next = firstEvent->next;
firstEvent->next = ev;
VisibilityLists(VIS_ADD, ev - event);
SetMSoundVar(i, NULL);
detonator.count++;
}
}
break;
case 4: case 4:
// open race track gates // open race track gates
TriggerDoor(&rioDoor[2], &stage[i], 0); TriggerDoor(&rioDoor[2], &stage[i], 0);