mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Fix: crash during group movement as GROUP pointer was corrupted
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7805 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2224,17 +2224,17 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
|||||||
|
|
||||||
if( gubNumGroupsArrivedSimultaneously )
|
if( gubNumGroupsArrivedSimultaneously )
|
||||||
{
|
{
|
||||||
pGroup = gpGroupList;
|
GROUP* pOtherGroup = gpGroupList;
|
||||||
while( gubNumGroupsArrivedSimultaneously && pGroup )
|
while ( gubNumGroupsArrivedSimultaneously && pOtherGroup )
|
||||||
{
|
{
|
||||||
next = pGroup->next;
|
next = pOtherGroup->next;
|
||||||
// WDS - Fix bug with 0 size group arriving at 0,0,0
|
// WDS - Fix bug with 0 size group arriving at 0,0,0
|
||||||
if( (pGroup->ubGroupSize > 0) && pGroup->uiFlags & GROUPFLAG_GROUP_ARRIVED_SIMULTANEOUSLY )
|
if ( (pOtherGroup->ubGroupSize > 0) && pOtherGroup->uiFlags & GROUPFLAG_GROUP_ARRIVED_SIMULTANEOUSLY )
|
||||||
{
|
{
|
||||||
gubNumGroupsArrivedSimultaneously--;
|
--gubNumGroupsArrivedSimultaneously;
|
||||||
HandleNonCombatGroupArrival( pGroup, FALSE, FALSE );
|
HandleNonCombatGroupArrival( pOtherGroup, FALSE, FALSE );
|
||||||
}
|
}
|
||||||
pGroup = next;
|
pOtherGroup = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2255,7 +2255,7 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: if a militia group has reached its final destination, add them to the current sector
|
// Flugente: if a militia group has reached its final destination, add them to the current sector
|
||||||
if ( pGroup->usGroupTeam == MILITIA_TEAM )
|
if ( pGroup && pGroup->usGroupTeam == MILITIA_TEAM )
|
||||||
{
|
{
|
||||||
// if they arrive in the sector we have currently loaded, let them join from the edge
|
// if they arrive in the sector we have currently loaded, let them join from the edge
|
||||||
// this will always remove them from the group - if you want them to continue moving, issue a new order
|
// this will always remove them from the group - if you want them to continue moving, issue a new order
|
||||||
|
|||||||
Reference in New Issue
Block a user