Skip to content

Commit

Permalink
vanilla bugfix for crash due to missing IsActive check when unit deat…
Browse files Browse the repository at this point in the history
…h animation overlaps a building
  • Loading branch information
ChthonVII committed Jun 23, 2021
1 parent 4a20df9 commit d454613
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Binary file added REDALERT/.INFANTRY.CPP.kate-swp
Binary file not shown.
3 changes: 2 additions & 1 deletion REDALERT/UNIT.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ void UnitClass::AI(void)
/*
** Scatter units off buildings in guard modes.
*/
if (!IsTethered && !IsFiring && !IsDriving && !IsRotating && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord].Cell_Building() != NULL) {
// Chthon CFE Note: bugfix missing IsActive check, as per https://github.com/TheAssemblyArmada/Vanilla-Conquer/pull/430
if (IsActive && !IsTethered && !IsFiring && !IsDriving && !IsRotating && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord].Cell_Building() != NULL) {
Scatter(0, true, true);
}

Expand Down
3 changes: 2 additions & 1 deletion TIBERIANDAWN/INFANTRY.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,8 @@ void InfantryClass::AI(void)
/*
** Scatter infantry off buildings in guard modes.
*/
if (!IsTethered && !IsFiring && !IsDriving && !IsRotating && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord_Cell(Coord)].Cell_Building() != NULL) {
// Chthon CFE Note: bugfix missing IsActive check, as per https://github.com/TheAssemblyArmada/Vanilla-Conquer/pull/430
if (IsActive && !IsTethered && !IsFiring && !IsDriving && !IsRotating && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord_Cell(Coord)].Cell_Building() != NULL) {
Scatter(0, true, true);
}

Expand Down
3 changes: 2 additions & 1 deletion TIBERIANDAWN/UNIT.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ void UnitClass::AI(void)
/*
** Scatter units off buildings in guard modes.
*/
if (!IsTethered && !IsFiring && !IsDriving && !IsRotating && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord_Cell(Coord)].Cell_Building() != NULL) {
// Chthon CFE Note: bugfix missing IsActive check, as per https://github.com/TheAssemblyArmada/Vanilla-Conquer/pull/430
if (IsActive && !IsTethered && !IsFiring && !IsDriving && !IsRotating && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord_Cell(Coord)].Cell_Building() != NULL) {
Scatter(0, true, true);
}

Expand Down

0 comments on commit d454613

Please sign in to comment.