aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJulien2012-07-22 22:24:27 -0400
committerJulien2012-07-27 00:14:56 -0400
commit95503250f82c71b4ca6849c5eb5581d3c6645202 (patch)
tree1332eecd4de616a0558c00d8d4cf44a1746b21b9 /engines
parent2e20e1d1e259dc6d9de8a90fa8417245f5a481b4 (diff)
downloadscummvm-rg350-95503250f82c71b4ca6849c5eb5581d3c6645202.tar.gz
scummvm-rg350-95503250f82c71b4ca6849c5eb5581d3c6645202.tar.bz2
scummvm-rg350-95503250f82c71b4ca6849c5eb5581d3c6645202.zip
LASTEXPRESS: Replace UPDATE_PARAM macro
Diffstat (limited to 'engines')
-rw-r--r--engines/lastexpress/entities/abbot.cpp21
-rw-r--r--engines/lastexpress/entities/alexei.cpp13
-rw-r--r--engines/lastexpress/entities/alouan.cpp4
-rw-r--r--engines/lastexpress/entities/anna.cpp43
-rw-r--r--engines/lastexpress/entities/august.cpp24
-rw-r--r--engines/lastexpress/entities/boutarel.cpp7
-rw-r--r--engines/lastexpress/entities/chapters.cpp3
-rw-r--r--engines/lastexpress/entities/cooks.cpp9
-rw-r--r--engines/lastexpress/entities/coudert.cpp33
-rw-r--r--engines/lastexpress/entities/entity.cpp20
-rw-r--r--engines/lastexpress/entities/entity.h2
-rw-r--r--engines/lastexpress/entities/entity_intern.h7
-rw-r--r--engines/lastexpress/entities/gendarmes.cpp3
-rw-r--r--engines/lastexpress/entities/hadija.cpp4
-rw-r--r--engines/lastexpress/entities/kahina.cpp3
-rw-r--r--engines/lastexpress/entities/mahmud.cpp9
-rw-r--r--engines/lastexpress/entities/max.cpp15
-rw-r--r--engines/lastexpress/entities/mertens.cpp21
-rw-r--r--engines/lastexpress/entities/milos.cpp18
-rw-r--r--engines/lastexpress/entities/mmeboutarel.cpp15
-rw-r--r--engines/lastexpress/entities/pascale.cpp3
-rw-r--r--engines/lastexpress/entities/rebecca.cpp10
-rw-r--r--engines/lastexpress/entities/salko.cpp6
-rw-r--r--engines/lastexpress/entities/tatiana.cpp16
-rw-r--r--engines/lastexpress/entities/vassili.cpp9
-rw-r--r--engines/lastexpress/entities/verges.cpp3
-rw-r--r--engines/lastexpress/entities/vesna.cpp9
-rw-r--r--engines/lastexpress/entities/yasmin.cpp4
28 files changed, 226 insertions, 108 deletions
diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp
index 9280068fae..c224b57abc 100644
--- a/engines/lastexpress/entities/abbot.cpp
+++ b/engines/lastexpress/entities/abbot.cpp
@@ -514,7 +514,8 @@ IMPLEMENT_FUNCTION(24, Abbot, function24)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->time, 900);
+ if (!Entity::updateParameter(params->param1, getState()->time, 900))
+ break;
setup_function25();
break;
@@ -615,7 +616,8 @@ IMPLEMENT_FUNCTION(26, Abbot, function26)
break;
case kActionNone:
- UPDATE_PARAM(params->param2, getState()->time, 4500);
+ if (!Entity::updateParameter(params->param2, getState()->time, 4500))
+ break;
if (getEntities()->isSomebodyInsideRestaurantOrSalon())
setup_function27();
@@ -862,7 +864,8 @@ IMPLEMENT_FUNCTION(31, Abbot, function31)
if (!params->param1)
break;
- UPDATE_PARAM(params->param5, getState()->time, 450);
+ if (!Entity::updateParameter(params->param5, getState()->time, 450))
+ break;
setCallback(6);
setup_callbackActionRestaurantOrSalon();
@@ -918,7 +921,8 @@ IMPLEMENT_FUNCTION(31, Abbot, function31)
getSavePoints()->push(kEntityAbbot, kEntityAlexei, kAction122288808);
params->param1 = 1;
- UPDATE_PARAM(params->param5, getState()->time, 450);
+ if (!Entity::updateParameter(params->param5, getState()->time, 450))
+ break;
setCallback(6);
setup_callbackActionRestaurantOrSalon();
@@ -1161,7 +1165,8 @@ IMPLEMENT_FUNCTION(36, Abbot, function36)
break;
case 2:
- UPDATE_PARAM(params->param4, getState()->time, 900);
+ if (!Entity::updateParameter(params->param4, getState()->time, 900))
+ break;
getSound()->playSound(kEntityAbbot, "Abb3042");
break;
@@ -1426,7 +1431,8 @@ label_callback_1:
TIME_CHECK(kTime2466000, params->param5, setup_function44);
if (params->param3) {
- UPDATE_PARAM(params->param6, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param6, getState()->timeTicks, 75))
+ break;
params->param2 = 1;
params->param3 = 0;
@@ -1748,7 +1754,8 @@ IMPLEMENT_FUNCTION(49, Abbot, pickBomb)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->timeTicks, 150);
+ if (!Entity::updateParameter(params->param1, getState()->timeTicks, 150))
+ break;
getSavePoints()->push(kEntityAbbot, kEntityAbbot, kAction157489665);
break;
diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp
index 437c31c476..c77b103f4d 100644
--- a/engines/lastexpress/entities/alexei.cpp
+++ b/engines/lastexpress/entities/alexei.cpp
@@ -314,7 +314,8 @@ IMPLEMENT_FUNCTION_IS(16, Alexei, function16, TimeValue)
}
if (params->param5) {
- UPDATE_PARAM(CURRENT_PARAM(1, 1), getState()->timeTicks, 75);
+ if (!Entity::updateParameter(CURRENT_PARAM(1, 1), getState()->timeTicks, 75))
+ break;
params->param5 = 0;
params->param6 = 1;
@@ -482,7 +483,9 @@ IMPLEMENT_FUNCTION(18, Alexei, chapter1Handler)
}
if (params->param1) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, 90))
+ break;
+
getScenes()->loadSceneFromPosition(kCarRestaurant, 61);
} else {
params->param3 = 0;
@@ -1348,7 +1351,8 @@ IMPLEMENT_FUNCTION(35, Alexei, function35)
UPDATE_PARAM_PROC_END
label_callback_3:
- UPDATE_PARAM(params->param4, getState()->time, 9000);
+ if (!Entity::updateParameter(params->param4, getState()->time, 9000))
+ break;
setCallback(4);
setup_callbackActionRestaurantOrSalon();
@@ -1397,7 +1401,8 @@ IMPLEMENT_FUNCTION(36, Alexei, function36)
if (params->param3 || params->param2)
break;
- UPDATE_PARAM(params->param4, getState()->timeTicks, params->param1);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, params->param1))
+ break;
getEntities()->drawSequenceRight(kEntityAlexei, "124B");
diff --git a/engines/lastexpress/entities/alouan.cpp b/engines/lastexpress/entities/alouan.cpp
index 589b712b16..7549aaf6e6 100644
--- a/engines/lastexpress/entities/alouan.cpp
+++ b/engines/lastexpress/entities/alouan.cpp
@@ -438,7 +438,9 @@ IMPLEMENT_FUNCTION(22, Alouan, function22)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->time, 2700);
+ if (!Entity::updateParameter(params->param1, getState()->time, 2700))
+ break;
+
setup_function23();
break;
diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp
index 806beaee9d..80a5144bbe 100644
--- a/engines/lastexpress/entities/anna.cpp
+++ b/engines/lastexpress/entities/anna.cpp
@@ -207,7 +207,8 @@ IMPLEMENT_FUNCTION(12, Anna, function12)
}
if (params->param4) {
- UPDATE_PARAM(params->param8, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param8, getState()->timeTicks, 75))
+ break;
params->param4 = 0;
params->param5 = 1;
@@ -427,7 +428,8 @@ IMPLEMENT_FUNCTION_IS(15, Anna, function15, TimeValue)
}
if (params->param5) {
- UPDATE_PARAM(params->param8, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param8, getState()->timeTicks, 75))
+ break;
params->param5 = 0;
params->param6 = 1;
@@ -675,7 +677,8 @@ IMPLEMENT_FUNCTION_I(18, Anna, function18, TimeValue)
}
if (params->param3) {
- UPDATE_PARAM(params->param7, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param7, getState()->timeTicks, 90))
+ break;
getScenes()->loadSceneFromPosition(kCarRestaurant, 61);
} else {
@@ -1157,7 +1160,8 @@ IMPLEMENT_FUNCTION(29, Anna, function29)
}
if (params->param1) {
- UPDATE_PARAM(params->param4, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, 90))
+ break;
getScenes()->loadSceneFromPosition(kCarRestaurant, 55);
} else {
@@ -1279,7 +1283,9 @@ IMPLEMENT_FUNCTION(30, Anna, function30)
}
if (params->param1) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 90))
+ break;
+
getScenes()->loadSceneFromPosition(kCarRestaurant, 55);
} else {
params->param5 = 0;
@@ -1483,7 +1489,8 @@ IMPLEMENT_FUNCTION(35, Anna, function35)
if (!params->param1)
break;
- UPDATE_PARAM(params->param3, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, 75))
+ break;
switch (params->param2) {
default:
@@ -1797,7 +1804,8 @@ IMPLEMENT_FUNCTION(41, Anna, function41)
break;
case kActionNone:
- UPDATE_PARAM(params->param2, getState()->time, 2700);
+ if (!Entity::updateParameter(params->param2, getState()->time, 2700))
+ break;
params->param5++;
switch (params->param5) {
@@ -2399,7 +2407,8 @@ IMPLEMENT_FUNCTION(53, Anna, function53)
}
if (params->param1) {
- UPDATE_PARAM(params->param7, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param7, getState()->timeTicks, 75))
+ break;
CursorStyle cursor = getEntities()->isInsideCompartment(kEntityMax, kCarRedSleeping, kPosition_4070) ? kCursorHand : kCursorNormal;
@@ -2545,7 +2554,8 @@ IMPLEMENT_FUNCTION(54, Anna, function54)
}
if (params->param1) {
- UPDATE_PARAM(params->param7, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param7, getState()->timeTicks, 75))
+ break;
CursorStyle cursor = getEntities()->isInsideCompartment(kEntityMax, kCarRedSleeping, kPosition_4070) ? kCursorHand : kCursorNormal;
@@ -2892,7 +2902,8 @@ IMPLEMENT_FUNCTION(59, Anna, function59)
}
if (params->param1) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
CursorStyle style = getEntities()->isInsideCompartment(kEntityMax, kCarRedSleeping, kPosition_4070) ? kCursorHand : kCursorNormal;
getObjects()->update(kObjectCompartmentF, kEntityAnna, kObjectLocation1, kCursorNormal, style);
@@ -3275,7 +3286,8 @@ IMPLEMENT_FUNCTION(67, Anna, chapter4Handler)
label_next:
if (params->param1) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 1;
@@ -3405,7 +3417,8 @@ IMPLEMENT_FUNCTION(69, Anna, function69)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param2, getState()->time, 4500);
+ if (!Entity::updateParameter(params->param2, getState()->time, 4500))
+ break;
getData()->car = kCarRedSleeping;
getData()->entityPosition = kPosition_9270;
@@ -3909,7 +3922,8 @@ IMPLEMENT_FUNCTION(80, Anna, function80)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->timeTicks, 450);
+ if (!Entity::updateParameter(params->param1, getState()->timeTicks, 450))
+ break;
getSound()->playSound(kEntityPlayer, "Kro5001", kFlagDefault);
break;
@@ -3978,7 +3992,8 @@ IMPLEMENT_FUNCTION(81, Anna, finalSequence)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->timeTicks, 180);
+ if (!Entity::updateParameter(params->param1, getState()->timeTicks, 180))
+ break;
getSound()->playSound(kEntityTrain, "LIB069");
getLogic()->gameOver(kSavegameTypeIndex, 2, kSceneNone, true);
diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp
index f255d041f8..d874c666f7 100644
--- a/engines/lastexpress/entities/august.cpp
+++ b/engines/lastexpress/entities/august.cpp
@@ -840,7 +840,8 @@ label_callback_9:
break;
if (getObjects()->get(kObjectCompartment1).location == kObjectLocation1) {
- UPDATE_PARAM(CURRENT_PARAM(1, 2), getState()->timeTicks, 75);
+ if (!Entity::updateParameter(CURRENT_PARAM(1, 2), getState()->timeTicks, 75))
+ break;
getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
@@ -1483,7 +1484,8 @@ IMPLEMENT_FUNCTION(30, August, restaurant)
break;
case kActionNone:
- UPDATE_PARAM(params->param3, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, 75))
+ break;
getData()->inventoryItem = kItemInvalid;
break;
@@ -1654,7 +1656,8 @@ IMPLEMENT_FUNCTION(32, August, function32)
}
if (params->param3) {
- UPDATE_PARAM(params->param8, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param8, getState()->timeTicks, 90))
+ break;
getScenes()->loadSceneFromPosition(kCarRestaurant, 55);
} else {
@@ -2768,7 +2771,8 @@ IMPLEMENT_FUNCTION(54, August, function54)
getData()->inventoryItem = kItemInvalid;
if (!params->param2 && params->param1) {
- UPDATE_PARAM(params->param5, getState()->time, params->param1);
+ if (!Entity::updateParameter(params->param5, getState()->time, params->param1))
+ break;
getData()->inventoryItem = kItemNone;
setup_function55();
@@ -3044,7 +3048,8 @@ IMPLEMENT_FUNCTION(60, August, function60)
if (!params->param1)
break;
- UPDATE_PARAM(params->param3, getState()->time, 9000);
+ if (!Entity::updateParameter(params->param3, getState()->time, 9000))
+ break;
setCallback(1);
setup_callbackActionRestaurantOrSalon();
@@ -3140,7 +3145,8 @@ IMPLEMENT_FUNCTION(62, August, function62)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->time, 900);
+ if (!Entity::updateParameter(params->param1, getState()->time, 900))
+ break;
getSound()->playSound(kEntityAugust, "Aug4003A");
@@ -3229,7 +3235,8 @@ IMPLEMENT_FUNCTION(63, August, function63)
break;
}
- UPDATE_PARAM(params->param5, getState()->timeTicks, params->param1);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, params->param1))
+ break;
params->param2 = (params->param6 < 1 ? 1 : 0);
@@ -3386,7 +3393,8 @@ IMPLEMENT_FUNCTION(68, August, function68)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param4, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 1;
diff --git a/engines/lastexpress/entities/boutarel.cpp b/engines/lastexpress/entities/boutarel.cpp
index ab5f019c49..ab8a0b9003 100644
--- a/engines/lastexpress/entities/boutarel.cpp
+++ b/engines/lastexpress/entities/boutarel.cpp
@@ -480,7 +480,9 @@ IMPLEMENT_FUNCTION_IS(17, Boutarel, function17, TimeValue)
break;
if (params->param5) {
- UPDATE_PARAM(params->param7, getState()->timeTicks, 90)
+ if (!Entity::updateParameter(params->param7, getState()->timeTicks, 90))
+ break;
+
getScenes()->loadSceneFromPosition(kCarRestaurant, 51);
} else {
params->param7 = 0;
@@ -515,7 +517,8 @@ IMPLEMENT_FUNCTION_I(18, Boutarel, function18, TimeValue)
}
if (params->param2) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
params->param2 = 0;
params->param3 = 1;
diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp
index b4978165b9..76165800f2 100644
--- a/engines/lastexpress/entities/chapters.cpp
+++ b/engines/lastexpress/entities/chapters.cpp
@@ -809,7 +809,8 @@ IMPLEMENT_FUNCTION(12, Chapters, chapter2Handler)
if (!getProgress().isTrainRunning)
break;
- UPDATE_PARAM(params->param2, getState()->timeTicks, params->param1);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, params->param1))
+ break;
getSound()->playLocomotiveSound();
diff --git a/engines/lastexpress/entities/cooks.cpp b/engines/lastexpress/entities/cooks.cpp
index 63494e6062..a3fb69aeb9 100644
--- a/engines/lastexpress/entities/cooks.cpp
+++ b/engines/lastexpress/entities/cooks.cpp
@@ -260,7 +260,8 @@ IMPLEMENT_FUNCTION(6, Cooks, chapter1Handler)
break;
case kActionNone:
- UPDATE_PARAM(params->param4, getState()->time, params->param2);
+ if (!Entity::updateParameter(params->param4, getState()->time, params->param2))
+ break;
// Broken plate sound
getSound()->playSound(kEntityPlayer, "LIB122", getSound()->getSoundFlag(kEntityCooks));
@@ -373,7 +374,8 @@ IMPLEMENT_FUNCTION(9, Cooks, chapter2Handler)
break;
case kActionNone:
- UPDATE_PARAM(params->param3, getState()->time, params->param1);
+ if (!Entity::updateParameter(params->param3, getState()->time, params->param1))
+ break;
// Broken plate sound
getSound()->playSound(kEntityPlayer, "LIB122", getSound()->getSoundFlag(kEntityCooks));
@@ -524,7 +526,8 @@ IMPLEMENT_FUNCTION(13, Cooks, chapter4Handler)
break;
case kActionNone:
- UPDATE_PARAM(params->param3, getState()->time, params->param1)
+ if (!Entity::updateParameter(params->param3, getState()->time, params->param1))
+ break;
// Broken plate sound
getSound()->playSound(kEntityPlayer, "LIB122", getSound()->getSoundFlag(kEntityCooks));
diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp
index e79d4cdff7..c589b8f0f8 100644
--- a/engines/lastexpress/entities/coudert.cpp
+++ b/engines/lastexpress/entities/coudert.cpp
@@ -356,7 +356,8 @@ IMPLEMENT_FUNCTION_I(10, Coudert, updateFromTime, uint32)
case kActionNone:
Entity::savegameBloodJacket();
- UPDATE_PARAM(params->param2, getState()->time, params->param1);
+ if (!Entity::updateParameter(params->param2, getState()->time, params->param1))
+ break;
callbackAction();
break;
@@ -379,7 +380,8 @@ IMPLEMENT_FUNCTION_I(11, Coudert, updateFromTicks, uint32)
case kActionNone:
Entity::savegameBloodJacket();
- UPDATE_PARAM(params->param2, getState()->timeTicks, params->param1);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, params->param1))
+ break;
callbackAction();
break;
@@ -476,7 +478,8 @@ IMPLEMENT_FUNCTION_II(13, Coudert, function13, bool, EntityIndex)
}
}
- UPDATE_PARAM(params->param5, getState()->timeTicks, 225);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 225))
+ break;
getData()->inventoryItem = kItemNone;
setCallback(5);
@@ -909,7 +912,8 @@ IMPLEMENT_FUNCTION_II(20, Coudert, function20, ObjectIndex, ObjectIndex)
getSound()->playSound(kEntityPlayer, "ZFX1004", getSound()->getSoundFlag(kEntityCoudert));
UPDATE_PARAM_PROC_END
- UPDATE_PARAM(CURRENT_PARAM(1, 4), getState()->time, 900);
+ if (!Entity::updateParameter(CURRENT_PARAM(1, 4), getState()->time, 900))
+ break;
getObjects()->updateLocation2((ObjectIndex)params->param1, kObjectLocation1);
@@ -988,7 +992,8 @@ IMPLEMENT_FUNCTION(21, Coudert, function21)
case kActionNone:
if (!params->param1) {
- UPDATE_PARAM(params->param2, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
+ break;
setCallback(3);
setup_enterExitCompartment("627Zh", kObjectCompartmentH);
@@ -1089,7 +1094,8 @@ IMPLEMENT_FUNCTION(22, Coudert, function22)
case kActionNone:
if (!params->param1) {
- UPDATE_PARAM(params->param2, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
+ break;
setCallback(3);
setup_enterExitCompartment("627Rg", kObjectCompartmentG);
@@ -1300,7 +1306,8 @@ IMPLEMENT_FUNCTION(26, Coudert, function26)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param2, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
+ break;
setCallback(3);
setup_enterExitCompartment2("627Zd", kObjectCompartmentD, kPosition_5790, kPosition_6130);
@@ -1391,7 +1398,8 @@ IMPLEMENT_FUNCTION(27, Coudert, function27)
case kActionNone:
if (!params->param1) {
- UPDATE_PARAM(params->param2, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
+ break;
setCallback(3);
setup_enterExitCompartment2("627Rc", kObjectCompartmentC, kPosition_6470, kPosition_6130);
@@ -1891,7 +1899,8 @@ IMPLEMENT_FUNCTION_I(35, Coudert, function35, bool)
getScenes()->loadSceneFromPosition(kCarRestaurant, 65);
}
- UPDATE_PARAM(params->param2, getState()->time, 2700);
+ if (!Entity::updateParameter(params->param2, getState()->time, 2700))
+ break;
getSavePoints()->push(kEntityCoudert, kEntityMax, kActionMaxFreeFromCage);
@@ -3558,7 +3567,8 @@ label_callback_5:
label_callback_6:
if (getState()->time > kTime2538000 && !ENTITY_PARAM(0, 1) && !ENTITY_PARAM(2, 1)) {
- UPDATE_PARAM(params->param7, getState()->time, 2700);
+ if (!Entity::updateParameter(params->param7, getState()->time, 2700))
+ break;
ENTITY_PARAM(0, 2) = 0;
ENTITY_PARAM(0, 1) = 1;
@@ -4023,7 +4033,8 @@ IMPLEMENT_FUNCTION(62, Coudert, function62)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param4, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 1;
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp
index 43f039df43..1989c4607b 100644
--- a/engines/lastexpress/entities/entity.cpp
+++ b/engines/lastexpress/entities/entity.cpp
@@ -346,7 +346,9 @@ void Entity::updateFromTicks(const SavePoint &savepoint) {
break;
case kActionNone:
- UPDATE_PARAM(params->param2, getState()->timeTicks, params->param1)
+ if (Entity::updateParameter(params->param2, getState()->timeTicks, params->param1))
+ break;
+
callbackAction();
break;
}
@@ -360,7 +362,9 @@ void Entity::updateFromTime(const SavePoint &savepoint) {
break;
case kActionNone:
- UPDATE_PARAM(params->param2, getState()->time, params->param1)
+ if (Entity::updateParameter(params->param2, getState()->time, params->param1))
+ break;
+
callbackAction();
break;
}
@@ -597,6 +601,18 @@ void Entity::callbackAction() {
// Helper functions
//////////////////////////////////////////////////////////////////////////
+bool Entity::updateParameter(uint &parameter, uint timeValue, uint delta) {
+ if (!parameter)
+ parameter = (uint)(timeValue + delta);
+
+ if (parameter >= timeValue)
+ return false;
+
+ parameter = kTimeInvalid;
+
+ return true;
+}
+
void Entity::timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action) {
if (getState()->time > timeValue && !parameter) {
parameter = 1;
diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h
index 3370659c6e..139f8ec418 100644
--- a/engines/lastexpress/entities/entity.h
+++ b/engines/lastexpress/entities/entity.h
@@ -870,6 +870,8 @@ protected:
// Helper functions
//////////////////////////////////////////////////////////////////////////
+ bool updateParameter(uint &parameter, uint time, uint delta);
+
void timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action);
void timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex index, ObjectLocation location);
bool timeCheckCallbackAction(TimeValue timeValue, uint &parameter);
diff --git a/engines/lastexpress/entities/entity_intern.h b/engines/lastexpress/entities/entity_intern.h
index 15a0a37c2f..23f5e49120 100644
--- a/engines/lastexpress/entities/entity_intern.h
+++ b/engines/lastexpress/entities/entity_intern.h
@@ -361,13 +361,6 @@ void class::setup_##name() { \
//////////////////////////////////////////////////////////////////////////
// Param update
//////////////////////////////////////////////////////////////////////////
-#define UPDATE_PARAM(parameter, type, value) { \
- if (!parameter) \
- parameter = (uint)(type + value); \
- if (parameter >= type) \
- break; \
- parameter = kTimeInvalid; \
-}
// Todo: replace with UPDATE_PARAM_PROC as appropriate
#define UPDATE_PARAM_GOTO(parameter, type, value, label) { \
diff --git a/engines/lastexpress/entities/gendarmes.cpp b/engines/lastexpress/entities/gendarmes.cpp
index fe9f6f0aa5..22697b396c 100644
--- a/engines/lastexpress/entities/gendarmes.cpp
+++ b/engines/lastexpress/entities/gendarmes.cpp
@@ -266,7 +266,8 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje
getSound()->playSound(kEntityGendarmes, "POL1046A", kFlagDefault);
}
- UPDATE_PARAM(params->param7, getState()->timeTicks, 300);
+ if (!Entity::updateParameter(params->param7, getState()->timeTicks, 300))
+ break;
if (!params->param4 && getEntities()->isOutsideAlexeiWindow()) {
getObjects()->update((ObjectIndex)params->param3, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
diff --git a/engines/lastexpress/entities/hadija.cpp b/engines/lastexpress/entities/hadija.cpp
index 4e72ce56f1..62badc46a6 100644
--- a/engines/lastexpress/entities/hadija.cpp
+++ b/engines/lastexpress/entities/hadija.cpp
@@ -466,7 +466,9 @@ IMPLEMENT_FUNCTION(22, Hadija, function22)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->time, 2700);
+ if (!Entity::updateParameter(params->param1, getState()->time, 2700))
+ break;
+
setup_function23();
break;
diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp
index 6bb2e6b90a..2124de1687 100644
--- a/engines/lastexpress/entities/kahina.cpp
+++ b/engines/lastexpress/entities/kahina.cpp
@@ -794,7 +794,8 @@ label_callback_2:
if (getEvent(kEventKahinaAskSpeakFirebird)
&& !getEvent(kEventKronosConversationFirebird)
&& getEntities()->isInsideTrainCar(kEntityPlayer, kCarKronos)) {
- UPDATE_PARAM(params->param4, getState()->time, 900);
+ if (!Entity::updateParameter(params->param4, getState()->time, 900))
+ break;
setCallback(3);
setup_savegame(kSavegameTypeEvent, kEventKronosConversationFirebird);
diff --git a/engines/lastexpress/entities/mahmud.cpp b/engines/lastexpress/entities/mahmud.cpp
index ebe754bfa4..1e7df5c870 100644
--- a/engines/lastexpress/entities/mahmud.cpp
+++ b/engines/lastexpress/entities/mahmud.cpp
@@ -84,7 +84,8 @@ IMPLEMENT_FUNCTION_SIII(4, Mahmud, enterExitCompartment2, ObjectIndex, uint32, O
break;
case kActionNone:
- UPDATE_PARAM(params->param7, getState()->timeTicks, params->param5);
+ if (!Entity::updateParameter(params->param7, getState()->timeTicks, params->param5))
+ break;
if (!getScenes()->checkPosition(kSceneNone, SceneManager::kCheckPositionLookingUp))
getScenes()->loadSceneFromObject((ObjectIndex)params->param6, true);
@@ -144,7 +145,8 @@ IMPLEMENT_FUNCTION_II(10, Mahmud, function10, ObjectIndex, bool)
break;
case kActionNone:
- UPDATE_PARAM(params->param6, getState()->time, 13500);
+ if (!Entity::updateParameter(params->param6, getState()->time, 13500))
+ break;
getObjects()->update(kObjectCompartment5, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand);
getObjects()->update(kObjectCompartment6, kEntityTrain, kObjectLocation3, kCursorHandKnock, kCursorHand);
@@ -570,7 +572,8 @@ IMPLEMENT_FUNCTION(14, Mahmud, chaptersHandler)
}
if (params->param5) {
- UPDATE_PARAM(params->param8, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param8, getState()->timeTicks, 75))
+ break;
params->param4 = 1;
params->param5 = 0;
diff --git a/engines/lastexpress/entities/max.cpp b/engines/lastexpress/entities/max.cpp
index cecfe64dc6..5c43346cde 100644
--- a/engines/lastexpress/entities/max.cpp
+++ b/engines/lastexpress/entities/max.cpp
@@ -89,7 +89,8 @@ IMPLEMENT_FUNCTION(6, Max, chapter12_handler)
break;
case kActionNone:
- UPDATE_PARAM(params->param2, getState()->time, params->param1);
+ if (!Entity::updateParameter(params->param2, getState()->time, params->param1))
+ break;
if (!getSoundQueue()->isBuffered(kEntityMax))
getSound()->playSound(kEntityMax, "Max1122");
@@ -123,7 +124,8 @@ IMPLEMENT_FUNCTION(7, Max, function7)
break;
case kActionNone:
- UPDATE_PARAM(params->param2, getState()->time, params->param1)
+ if (!Entity::updateParameter(params->param2, getState()->time, params->param1))
+ break;
if (!getSoundQueue()->isBuffered(kEntityMax))
getSound()->playSound(kEntityMax, "Max1122");
@@ -212,7 +214,8 @@ IMPLEMENT_FUNCTION(8, Max, chapter4Handler)
break;
case kActionNone:
- UPDATE_PARAM(params->param3, getState()->time, params->param2);
+ if (!Entity::updateParameter(params->param3, getState()->time, params->param2))
+ break;
if (!getSoundQueue()->isBuffered(kEntityMax))
getSound()->playSound(kEntityMax, "Max3101");
@@ -390,7 +393,8 @@ IMPLEMENT_FUNCTION(13, Max, chapter3Handler)
break;
}
- UPDATE_PARAM(params->param3, getState()->time, params->param1);
+ if (!Entity::updateParameter(params->param3, getState()->time, params->param1))
+ break;
if (!getSoundQueue()->isBuffered(kEntityMax))
getSound()->playSound(kEntityMax, "Max1122");
@@ -512,7 +516,8 @@ IMPLEMENT_FUNCTION(15, Max, function15)
}
if (!params->param1) {
- UPDATE_PARAM(params->param3, getState()->time, 900);
+ if (!Entity::updateParameter(params->param3, getState()->time, 900))
+ break;
getSavePoints()->push(kEntityMax, kEntityCoudert, kAction157026693);
}
diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp
index 37e7bf5ca6..c093ac4b30 100644
--- a/engines/lastexpress/entities/mertens.cpp
+++ b/engines/lastexpress/entities/mertens.cpp
@@ -464,7 +464,8 @@ IMPLEMENT_FUNCTION_I(11, Mertens, function11, uint32)
case kActionNone:
Entity::savegameBloodJacket();
- UPDATE_PARAM(params->param2, getState()->time, params->param1)
+ if (!Entity::updateParameter(params->param2, getState()->time, params->param1))
+ break;
callbackAction();
break;
@@ -1062,7 +1063,8 @@ IMPLEMENT_FUNCTION_II(21, Mertens, function21, ObjectIndex, ObjectIndex)
getSound()->playSound(kEntityPlayer, "ZFX1004", getSound()->getSoundFlag(kEntityMertens));
UPDATE_PARAM_PROC_END
- UPDATE_PARAM(CURRENT_PARAM(1, 5), getState()->time, 900);
+ if (!Entity::updateParameter(CURRENT_PARAM(1, 5), getState()->time, 900))
+ break;
// Update objects
getObjects()->updateLocation2((ObjectIndex)params->param1, kObjectLocation1);
@@ -1286,7 +1288,8 @@ IMPLEMENT_FUNCTION(24, Mertens, function24)
case kActionNone:
if (!params->param1) {
- UPDATE_PARAM(params->param2, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
+ break;
setCallback(3);
setup_enterExitCompartment3("601Rc", kObjectCompartment3, kPosition_6470, kPosition_6130);
@@ -1389,7 +1392,8 @@ IMPLEMENT_FUNCTION(25, Mertens, function25)
case kActionNone:
if (!params->param1) {
- UPDATE_PARAM(params->param2, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
+ break;
setCallback(3);
setup_enterExitCompartment3("601Zb", kObjectCompartment2, kPosition_7500, kPositionNone);
@@ -1626,7 +1630,8 @@ label_callback10:
if (params->param3 >= getState()->timeTicks) {
label_callback11:
- UPDATE_PARAM(params->param4, getState()->timeTicks, 375);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, 375))
+ break;
getSound()->playSound(kEntityPlayer, "LIB033");
@@ -3736,7 +3741,8 @@ label_callback_7:
label_callback_8:
if (getState()->time > kTime2538000 && !ENTITY_PARAM(0, 1) && !ENTITY_PARAM(2, 1)) {
- UPDATE_PARAM(params->param6, getState()->time, 2700);
+ if (!Entity::updateParameter(params->param6, getState()->time, 2700))
+ break;
getEntities()->drawSequenceLeft(kEntityMertens, "601E");
@@ -3990,7 +3996,8 @@ IMPLEMENT_FUNCTION(53, Mertens, function53)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param4, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 0;
diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp
index c33a8b887e..8ebb23b024 100644
--- a/engines/lastexpress/entities/milos.cpp
+++ b/engines/lastexpress/entities/milos.cpp
@@ -434,7 +434,8 @@ IMPLEMENT_FUNCTION(14, Milos, function14)
if (CURRENT_PARAM(1, 1) < getState()->timeTicks) {
if (getObjects()->get(kObjectCompartment1).location == kObjectLocation1) {
- UPDATE_PARAM(CURRENT_PARAM(1, 2), getState()->timeTicks, 75);
+ if (!Entity::updateParameter(CURRENT_PARAM(1, 2), getState()->timeTicks, 75))
+ break;
getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
@@ -505,7 +506,8 @@ IMPLEMENT_FUNCTION(14, Milos, function14)
}
label_callback_12:
- UPDATE_PARAM(CURRENT_PARAM(1, 4), getState()->timeTicks, 75);
+ if (!Entity::updateParameter(CURRENT_PARAM(1, 4), getState()->timeTicks, 75))
+ break;
getEntities()->exitCompartment(kEntityMilos, kObjectCompartment1, true);
@@ -736,7 +738,8 @@ IMPLEMENT_FUNCTION(15, Milos, chapter1Handler)
}
if (getEntities()->isPlayerPosition(kCarRestaurant, 70) && !params->param2) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 45);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 45))
+ break;
setCallback(2);
setup_draw("009C");
@@ -951,7 +954,8 @@ IMPLEMENT_FUNCTION(21, Milos, function21)
break;
case kActionNone:
- UPDATE_PARAM(params->param2, getState()->time, 4500);
+ if (!Entity::updateParameter(params->param2, getState()->time, 4500))
+ break;
params->param1 = 1;
break;
@@ -1116,7 +1120,8 @@ IMPLEMENT_FUNCTION(24, Milos, function24)
}
if (params->param1) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 1;
@@ -1289,7 +1294,8 @@ IMPLEMENT_FUNCTION(25, Milos, function25)
}
if (params->param1) {
- UPDATE_PARAM(params->param4, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 1;
diff --git a/engines/lastexpress/entities/mmeboutarel.cpp b/engines/lastexpress/entities/mmeboutarel.cpp
index ace8637556..323e686ec3 100644
--- a/engines/lastexpress/entities/mmeboutarel.cpp
+++ b/engines/lastexpress/entities/mmeboutarel.cpp
@@ -427,7 +427,8 @@ label_callback_1:
TIME_CHECK(kTime1094400, params->param8, setup_function14);
if (params->param4) {
- UPDATE_PARAM(CURRENT_PARAM(1, 1), getState()->timeTicks, 75);
+ if (!Entity::updateParameter(CURRENT_PARAM(1, 1), getState()->timeTicks, 75))
+ break;
params->param3 = 1;
params->param4 = 0;
@@ -587,7 +588,8 @@ IMPLEMENT_FUNCTION(15, MmeBoutarel, function15)
label_callback_5:
if (params->param2) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
params->param1 = 1;
params->param2 = 0;
@@ -1016,7 +1018,8 @@ IMPLEMENT_FUNCTION(23, MmeBoutarel, chapter4Handler)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param2, getState()->time, 900);
+ if (!Entity::updateParameter(params->param2, getState()->time, 900))
+ break;
getObjects()->update(kObjectCompartmentD, kEntityPlayer, kObjectLocation1, kCursorKeepValue, kCursorKeepValue);
@@ -1065,7 +1068,8 @@ IMPLEMENT_FUNCTION(24, MmeBoutarel, function24)
TIME_CHECK(kTime2470500, params->param4, setup_function25);
if (params->param2) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
params->param1 = 1;
params->param2 = 0;
@@ -1208,7 +1212,8 @@ IMPLEMENT_FUNCTION(28, MmeBoutarel, function28)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 1;
diff --git a/engines/lastexpress/entities/pascale.cpp b/engines/lastexpress/entities/pascale.cpp
index 6620634ade..e74cf3490f 100644
--- a/engines/lastexpress/entities/pascale.cpp
+++ b/engines/lastexpress/entities/pascale.cpp
@@ -1126,7 +1126,8 @@ IMPLEMENT_FUNCTION(33, Pascale, function33)
label_callback1:
if (params->param1) {
- UPDATE_PARAM(params->param6, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param6, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 2;
diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp
index 3ef266994f..a890ebf258 100644
--- a/engines/lastexpress/entities/rebecca.cpp
+++ b/engines/lastexpress/entities/rebecca.cpp
@@ -708,7 +708,9 @@ label_callback_4:
label_callback_5:
if (params->param2) {
- UPDATE_PARAM(params->param6, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param6, getState()->timeTicks, 90))
+ break;
+
getScenes()->loadSceneFromPosition(kCarRestaurant, 55);
} else {
params->param6 = 0;
@@ -966,7 +968,8 @@ IMPLEMENT_FUNCTION(26, Rebecca, function26)
TIME_CHECK_CALLBACK_3(kTime1224000, params->param2, 1, setup_updatePosition, "118H", kCarRestaurant, 52);
if (params->param1) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, 90))
+ break;
getScenes()->loadSceneFromPosition(kCarRestaurant, 51);
}
@@ -1753,7 +1756,8 @@ IMPLEMENT_FUNCTION(48, Rebecca, function48)
case kActionNone:
if (params->param1) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, 75))
+ break;
params->param1 = 0;
params->param2 = 1;
diff --git a/engines/lastexpress/entities/salko.cpp b/engines/lastexpress/entities/salko.cpp
index 70a26b515a..b799564b46 100644
--- a/engines/lastexpress/entities/salko.cpp
+++ b/engines/lastexpress/entities/salko.cpp
@@ -299,7 +299,8 @@ IMPLEMENT_FUNCTION(15, Salko, chapter3Handler)
case kActionNone:
if (getState()->time < kTime2200500) {
- UPDATE_PARAM(params->param1, getState()->time, 81000);
+ if (!Entity::updateParameter(params->param1, getState()->time, 81000))
+ break;
setCallback(1);
setup_function16();
@@ -329,7 +330,8 @@ IMPLEMENT_FUNCTION(16, Salko, function16)
}
label_callback3:
- UPDATE_PARAM(params->param1, getState()->time, 4500);
+ if (!Entity::updateParameter(params->param1, getState()->time, 4500))
+ break;
getSavePoints()->push(kEntitySalko, kEntitySalko, kAction101169464);
break;
diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp
index b15a0a18b2..76068aad24 100644
--- a/engines/lastexpress/entities/tatiana.cpp
+++ b/engines/lastexpress/entities/tatiana.cpp
@@ -249,7 +249,8 @@ IMPLEMENT_FUNCTION_I(16, Tatiana, function16, uint32)
}
if (params->param2) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
params->param2 = 0;
params->param3 = 1;
@@ -443,7 +444,9 @@ label_tatiana_chapter1_2:
Entity::timeCheckSavepoint(kTime1084500, params->param7, kEntityTatiana, kEntityPascale, kAction257489762);
if (params->param1) {
- UPDATE_PARAM(params->param8, getState()->timeTicks, 90);
+ if (!Entity::updateParameter(params->param8, getState()->timeTicks, 90))
+ break;
+
getScenes()->loadSceneFromPosition(kCarRestaurant, 65);
} else {
params->param8 = 0;
@@ -1292,7 +1295,8 @@ IMPLEMENT_FUNCTION(37, Tatiana, function37)
}
if (params->param1) {
- UPDATE_PARAM(params->param5, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param5, getState()->timeTicks, 75))
+ break;
getObjects()->update(kObjectCompartmentB, kEntityTatiana, kObjectLocation1, kCursorNormal, kCursorNormal);
getObjects()->update(kObject49, kEntityTatiana, kObjectLocation1, kCursorNormal, kCursorNormal);
@@ -1401,7 +1405,8 @@ IMPLEMENT_FUNCTION(38, Tatiana, function38)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->time, 450);
+ if (!Entity::updateParameter(params->param1, getState()->time, 450))
+ break;
getEntities()->exitCompartment(kEntityTatiana, kObjectCompartmentF, true);
@@ -2197,7 +2202,8 @@ IMPLEMENT_FUNCTION(54, Tatiana, function54)
}
if (params->param1 > 3) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, 225);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, 225))
+ break;
params->param1 = 0;
params->param3 = 0;
diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp
index 5079fdb252..6504df7928 100644
--- a/engines/lastexpress/entities/vassili.cpp
+++ b/engines/lastexpress/entities/vassili.cpp
@@ -400,7 +400,8 @@ IMPLEMENT_FUNCTION(13, Vassili, sleeping)
case kActionNone:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarRedSleeping, kPosition_8200)) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, params->param1);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, params->param1))
+ break;
setCallback(1);
setup_draw("303B");
@@ -459,7 +460,8 @@ IMPLEMENT_FUNCTION(15, Vassili, stealEgg)
case kActionNone:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarRedSleeping, kPosition_8200)) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, params->param1);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, params->param1))
+ break;
setCallback(1);
setup_draw("303B");
@@ -543,7 +545,8 @@ IMPLEMENT_FUNCTION(17, Vassili, chapter4Handler)
case kActionNone:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarRedSleeping, kPosition_8200)) {
- UPDATE_PARAM(params->param3, getState()->timeTicks, params->param1);
+ if (!Entity::updateParameter(params->param3, getState()->timeTicks, params->param1))
+ break;
setCallback(1);
setup_draw("303B");
diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp
index bdd758a5be..f459b6f8e7 100644
--- a/engines/lastexpress/entities/verges.cpp
+++ b/engines/lastexpress/entities/verges.cpp
@@ -244,7 +244,8 @@ IMPLEMENT_FUNCTION_IIS(10, Verges, function10, CarIndex, EntityPosition)
}
if (params->param6) {
- UPDATE_PARAM(params->param8, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(params->param8, getState()->timeTicks, 75))
+ break;
getSound()->playSound(kEntityVerges, (char *)&params->seq);
diff --git a/engines/lastexpress/entities/vesna.cpp b/engines/lastexpress/entities/vesna.cpp
index b0ee9bcbc1..6889be4335 100644
--- a/engines/lastexpress/entities/vesna.cpp
+++ b/engines/lastexpress/entities/vesna.cpp
@@ -162,7 +162,8 @@ IMPLEMENT_FUNCTION(11, Vesna, function11)
case kActionNone:
if (parameters->param3) {
- UPDATE_PARAM(parameters->param7, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(parameters->param7, getState()->timeTicks, 75))
+ break;
parameters->param2 = 1;
parameters->param3 = 0;
@@ -511,7 +512,8 @@ IMPLEMENT_FUNCTION(20, Vesna, chapter3Handler)
}
if (parameters->param2) {
- UPDATE_PARAM(parameters->param8, getState()->timeTicks, 75);
+ if (!Entity::updateParameter(parameters->param8, getState()->timeTicks, 75))
+ break;
parameters->param1 = 1;
parameters->param2 = 0;
@@ -1086,7 +1088,8 @@ IMPLEMENT_FUNCTION(30, Vesna, function30)
UPDATE_PARAM_PROC_END
}
- UPDATE_PARAM(params->param4, getState()->timeTicks, 180);
+ if (!Entity::updateParameter(params->param4, getState()->timeTicks, 180))
+ break;
setCallback(1);
setup_savegame(kSavegameTypeEvent, kEventCathVesnaTrainTopKilled);
diff --git a/engines/lastexpress/entities/yasmin.cpp b/engines/lastexpress/entities/yasmin.cpp
index 6fb1936303..f2b4d2edd1 100644
--- a/engines/lastexpress/entities/yasmin.cpp
+++ b/engines/lastexpress/entities/yasmin.cpp
@@ -445,7 +445,9 @@ IMPLEMENT_FUNCTION(20, Yasmin, function20)
break;
case kActionNone:
- UPDATE_PARAM(params->param1, getState()->time, 2700);
+ if (!Entity::updateParameter(params->param1, getState()->time, 2700))
+ break;
+
setup_function21();
break;