From f64f58fbf8700b1adfd2aa0101ed5a250cf8b9a5 Mon Sep 17 00:00:00 2001 From: ChrisL Date: Mon, 12 Jan 2009 16:51:34 +0000 Subject: [PATCH] Bugfix: I've simply added a condition to a pair of assertions so that they won't run when a soldier is assigned to a vehicle. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2485 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/strategicmap.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index a5299837..c37ef466 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -1777,7 +1777,9 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) { //CHRISL: We should only bother with this assertion if the soldier is alive. Dead soliders are moved to // GridNo = NOWHERE, which causes this assertion to fail - if(!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD)) + //CHRISL: There's also an issue with vehicles. Soldiers in any vehicle are considered to be in sGridNo = NOWHERE + // This will result in an assertion error, so let's skip the assertion if the merc is assigned to a vehicle + if(!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD) && MercPtrs[i]->bAssignment != VEHICLE) { Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE || MercPtrs[i]->bVehicleID == iHelicopterVehicleId ); } @@ -1821,7 +1823,9 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) { //CHRISL: We should only bother with this assertion if the soldier is alive. Dead soliders are moved to // GridNo = NOWHERE, which causes this assertion to fail - if(!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD)) + //CHRISL: There's also an issue with vehicles. Soldiers in any vehicle are considered to be in sGridNo = NOWHERE + // This will result in an assertion error, so let's skip the assertion if the merc is assigned to a vehicle + if(!(MercPtrs[i]->flags.uiStatusFlags & SOLDIER_DEAD) && MercPtrs[i]->bAssignment != VEHICLE) { Assert( !MercPtrs[i]->bActive || !MercPtrs[i]->bInSector || MercPtrs[i]->sGridNo != NOWHERE || MercPtrs[i]->bVehicleID == iHelicopterVehicleId ); }