1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-02-24 23:42:49 +01:00

fix trigger parser

This commit is contained in:
XProger 2018-09-29 20:09:12 +03:00
parent c93d7221d9
commit bc55f32541

View File

@ -403,15 +403,22 @@ struct Controller {
}
case TR::FloorData::TRIGGER : {
if (info.trigCmdCount) break;
info.trigger = (TR::Level::Trigger::Type)cmd.sub;
info.trigCmdCount = 0;
info.trigInfo = (*fd++).triggerInfo;
bool skip = info.trigCmdCount > 0;
if (!skip) {
info.trigger = (TR::Level::Trigger::Type)cmd.sub;
info.trigCmdCount = 0;
info.trigInfo = (*fd++).triggerInfo;
} else
fd++;
TR::FloorData::TriggerCommand trigCmd;
do {
ASSERT(info.trigCmdCount < MAX_TRIGGER_COMMANDS);
trigCmd = (*fd++).triggerCmd; // trigger action
info.trigCmd[info.trigCmdCount++] = trigCmd;
if (!skip) {
ASSERT(info.trigCmdCount < MAX_TRIGGER_COMMANDS);
info.trigCmd[info.trigCmdCount++] = trigCmd;
}
} while (!trigCmd.end);
break;
}