mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Fixed CTD in editor when changing detailed civ placement from wheelchair to jeep
Fixed memory corruption in detailed placement due to old-inventory behavior Added Editor.slf to files JA2/Editor will load from Fixed FindBestPath to not search for a path to NOWHERE git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1362 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2082,6 +2082,10 @@ INT32 FindBestPath(SOLDIERTYPE *s , INT16 sDestination, INT8 ubLevel, INT16 usMo
|
||||
iOriginationX = iOriginationY = 0;
|
||||
iOrigination = (INT32) s->sGridNo;
|
||||
|
||||
if (sDestination == NOWHERE)
|
||||
{
|
||||
return 0; // There is no path to nowhere, because everywhere you can go is somewhere!
|
||||
}
|
||||
if (iOrigination < 0 || iOrigination > WORLD_MAX)
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
|
||||
@@ -301,7 +301,7 @@ BOOLEAN LoadSoldiersFromMap( INT8 **hBuffer )
|
||||
LOADDATA( &tempDetailedPlacement, *hBuffer, SIZEOF_SOLDIERCREATE_STRUCT_POD );
|
||||
tempDetailedPlacement.CopyOldInventoryToNew();
|
||||
//allocate memory for new static detailed placement
|
||||
pNode->pDetailedPlacement = new (MemAlloc( SIZEOF_SOLDIERCREATE_STRUCT )) SOLDIERCREATE_STRUCT;//(SOLDIERCREATE_STRUCT*)MemAlloc( SIZEOF_SOLDIERCREATE_STRUCT );
|
||||
pNode->pDetailedPlacement = new SOLDIERCREATE_STRUCT;//(SOLDIERCREATE_STRUCT*)MemAlloc( SIZEOF_SOLDIERCREATE_STRUCT );
|
||||
if( !pNode->pDetailedPlacement )
|
||||
{
|
||||
AssertMsg( 0, "Failed to allocate memory for new detailed placement in LoadSoldiersFromMap." );
|
||||
|
||||
Reference in New Issue
Block a user