- fixed destroyed mission car not able to fail the mission

This commit is contained in:
Ilya Shurumov 2021-02-04 02:22:12 +06:00
parent 951f26d2f6
commit 5d7f77ce6a

View File

@ -2459,29 +2459,38 @@ int MRProcessTarget(MR_THREAD *thread, MS_TARGET *target)
if (gCurrentMissionNumber == 11 ||
gCurrentMissionNumber == 14 ||
gCurrentMissionNumber == 19 ||
gCurrentMissionNumber == 28 ||
cp->totalDamage < MaxPlayerDamage[0])
gCurrentMissionNumber == 26 ||
gCurrentMissionNumber == 28)
{
// Find the Clue and Steal the keys
int failIfDamaged;
failIfDamaged = (gCurrentMissionNumber != 14 && gCurrentMissionNumber != 28);
// check if player entered the car
if (player[0].playerCarId == slot)
{
car_data[player[0].playerCarId].inform = NULL;
cp->inform = NULL;
if (gCurrentMissionNumber == 14 || gCurrentMissionNumber == 28)
// signal to mission about stolen car so Find the Clue/Steal the keys can progress
if (!failIfDamaged)
{
cp->totalDamage = MaxPlayerDamage[0];
ret = 1;
if (MaxPlayerDamage[0] <= cp->totalDamage)
gGotInStolenCar = 1;
}
ret = 1;
}
break;
// check if target car is damaged
if(failIfDamaged && cp->totalDamage >= MaxPlayerDamage[0])
{
message = MissionStrings + MissionHeader->msgCarWrecked;
SetPlayerMessage(thread->player, message, 2, 1);
SetMissionFailed(FAILED_MESSAGESET);
}
}
message = MissionStrings + MissionHeader->msgCarWrecked;
SetPlayerMessage(thread->player, message, 2, 1);
SetMissionFailed(FAILED_MESSAGESET);
break;
}
case 64:
@ -2889,20 +2898,17 @@ int HandleGameOver(void)
if (tannerDeathTimer == 64)
lp->dying = 1;
if (lp->dying != 0)
if (lp->dying && !gGotInStolenCar)
{
if (gGotInStolenCar == 0)
{
if (Mission.timer[player_id].flags & TIMER_FLAG_BOMB_COUNTDOWN)
BombThePlayerToHellAndBack(gCarWithABerm);
if (Mission.timer[player_id].flags & TIMER_FLAG_BOMB_COUNTDOWN)
BombThePlayerToHellAndBack(gCarWithABerm);
if (lp->playerType == 2)
SetPlayerMessage(player_id, MissionStrings + MissionHeader->msgDrowned, 2, 2);
else
SetPlayerMessage(player_id, MissionStrings + MissionHeader->msgCarWrecked, 2, 2);
if (lp->playerType == 2)
SetPlayerMessage(player_id, MissionStrings + MissionHeader->msgDrowned, 2, 2);
else
SetPlayerMessage(player_id, MissionStrings + MissionHeader->msgCarWrecked, 2, 2);
lp->dying++;
}
lp->dying++;
}
if (lp->dying > 40)