Fix: dragging a structure repaired it and removed all decals

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9120 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2021-06-28 14:52:12 +00:00
parent 587b7e2874
commit 6f24fb89fd
4 changed files with 41 additions and 5 deletions
+10 -2
View File
@@ -11864,11 +11864,17 @@ void SOLDIERTYPE::MoveMerc( FLOAT dMovementChange, FLOAT dAngle, BOOLEAN fCheckR
bool success = false;
UINT32 arusTileType;
UINT16 arusStructureNumber;
if ( IsDragStructurePresent( this->sDragGridNo, this->pathing.bLevel, arusTileType, arusStructureNumber ) )
UINT8 hitpoints;
UINT8 decalflag;
if ( IsDragStructurePresent( this->sDragGridNo, this->pathing.bLevel, arusTileType, arusStructureNumber, hitpoints, decalflag ) )
{
// add
if ( BuildStructDrag( sOldGridNo, gsInterfaceLevel, arusTileType, arusStructureNumber, this->ubID ) )
{
// as structures might be damaged/have decals, make sure to keep the old values
CorrectDragStructData( sOldGridNo, (INT8)gsInterfaceLevel, hitpoints, decalflag );
// remove
RemoveStructDrag( this->sDragGridNo, (INT8)gsInterfaceLevel, arusTileType );
@@ -20698,7 +20704,9 @@ BOOLEAN SOLDIERTYPE::CanDragStructure( INT32 sGridNo )
UINT32 tiletype;
UINT16 structurenumber;
if ( !IsDragStructurePresent( sGridNo, this->pathing.bLevel, tiletype, structurenumber ) )
UINT8 hitpoints;
UINT8 decalflag;
if ( !IsDragStructurePresent( sGridNo, this->pathing.bLevel, tiletype, structurenumber, hitpoints, decalflag ) )
return FALSE;
// Now we need to check if there is not a wall between the two middle tiles