Skip to content

Commit 83ee195

Browse files
committed
[GEN][ZH] fix object deselection logic in BuildAssistant::sellObject()
1 parent cac806a commit 83ee195

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

Generals/Code/GameEngine/Source/Common/System/BuildAssistant.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,18 +1511,20 @@ void BuildAssistant::sellObject( Object *obj )
15111511
// set the model condition in the drawable for this object that will show the buildup
15121512
// scaffold and adjust the model height by construction percent
15131513
//
1514-
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED,
1515-
MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1514+
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED, MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1515+
1516+
// TheSuperHackers @bugfix Mauller 27/06/2025 we need to deselect the object before setting it as unselectable
1517+
// If the object is set unselectable too soon, it fails to be removed from the selection group
1518+
1519+
// for everybody, unselect them at this time. You can't just deselect a drawable. Selection is a logic property.
1520+
TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE);
15161521

15171522
//
15181523
// set this object as under de-construction (sold). It is still a legal target, since you get the money at
15191524
// the completion of sale.
15201525
//
15211526
obj->setStatus( MAKE_OBJECT_STATUS_MASK2( OBJECT_STATUS_SOLD, OBJECT_STATUS_UNSELECTABLE ) );
15221527

1523-
// for everybody, unselect them at this time. You can't just deselect a drawable. Selection is a logic property.
1524-
TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE);
1525-
15261528
//
15271529
// set the animation durations so that the regular build up loop animations can be
15281530
// done a bit faster for selling

GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,18 +1536,20 @@ void BuildAssistant::sellObject( Object *obj )
15361536
// set the model condition in the drawable for this object that will show the buildup
15371537
// scaffold and adjust the model height by construction percent
15381538
//
1539-
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED,
1540-
MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1539+
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED, MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1540+
1541+
// TheSuperHackers @bugfix Mauller 27/06/2025 we need to deselect the object before setting it as unselectable
1542+
// If the object is set unselectable too soon, it fails to be removed from the selection group
1543+
1544+
// for everybody, unselect them at this time. You can't just deselect a drawable. Selection is a logic property.
1545+
TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE);
15411546

15421547
//
15431548
// set this object as under de-construction (sold). It is still a legal target, since you get the money at
15441549
// the completion of sale.
15451550
//
15461551
obj->setStatus( MAKE_OBJECT_STATUS_MASK2( OBJECT_STATUS_SOLD, OBJECT_STATUS_UNSELECTABLE ) );
15471552

1548-
// for everybody, unselect them at this time. You can't just deselect a drawable. Selection is a logic property.
1549-
TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE);
1550-
15511553
//
15521554
// set the animation durations so that the regular build up loop animations can be
15531555
// done a bit faster for selling

0 commit comments

Comments
 (0)