Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions TombEngine/Game/control/trigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,44 @@ void TestTriggers(int x, int y, int z, FloorInfo* floor, Activator activator, bo
}
break;

case TO_VOLUME:
{
// Find the volume by global index across all rooms
int globalIndex = 0;
TriggerVolume* targetVolume = nullptr;

for (auto& room : g_Level.Rooms)
{
for (auto& volume : room.TriggerVolumes)
{
if (globalIndex == value)
{
targetVolume = &volume;
break;
}
globalIndex++;
}
if (targetVolume != nullptr)
break;
}

if (targetVolume != nullptr)
{
// Set volume enabled state based on trigger type
if (triggerType == TRIGGER_TYPES::ANTIPAD ||
triggerType == TRIGGER_TYPES::ANTITRIGGER ||
triggerType == TRIGGER_TYPES::HEAVYANTITRIGGER)
{
targetVolume->Enabled = false;
}
else
{
targetVolume->Enabled = true;
}
}
}
break;

case TO_VOLUMEEVENT:
case TO_GLOBALEVENT:
trigger = *(data++);
Expand Down
1 change: 1 addition & 0 deletions TombEngine/Game/control/trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum TRIGOBJECTS_TYPES
TO_CUTSCENE,
TO_UNUSED1, // TRNG FmvNg
TO_UNUSED2, // TRNG TimerfieldNg
TO_VOLUME,
TO_VOLUMEEVENT,
TO_GLOBALEVENT
};
Expand Down