Skip to content

Commit ad4fc6e

Browse files
committed
[GEN][ZH] fix object deselection logic in BuildAssistant::sellObject()
1 parent 321ff11 commit ad4fc6e

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
@@ -1506,18 +1506,20 @@ void BuildAssistant::sellObject( Object *obj )
15061506
// set the model condition in the drawable for this object that will show the buildup
15071507
// scaffold and adjust the model height by construction percent
15081508
//
1509-
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED,
1510-
MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1509+
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED, MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1510+
1511+
// TheSuperHackers @bugfix Mauller 27/06/2025 we need to deselect the object before setting it as unselectable
1512+
// If the object is set unselectable too soon, it fails to be removed from the selection group
1513+
1514+
// for everybody, unselect them at this time. You can't just deselect a drawable. Selection is a logic property.
1515+
TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE);
15111516

15121517
//
15131518
// set this object as under de-construction (sold). It is still a legal target, since you get the money at
15141519
// the completion of sale.
15151520
//
15161521
obj->setStatus( MAKE_OBJECT_STATUS_MASK2( OBJECT_STATUS_SOLD, OBJECT_STATUS_UNSELECTABLE ) );
15171522

1518-
// for everybody, unselect them at this time. You can't just deselect a drawable. Selection is a logic property.
1519-
TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE);
1520-
15211523
//
15221524
// set the animation durations so that the regular build up loop animations can be
15231525
// 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
@@ -1531,18 +1531,20 @@ void BuildAssistant::sellObject( Object *obj )
15311531
// set the model condition in the drawable for this object that will show the buildup
15321532
// scaffold and adjust the model height by construction percent
15331533
//
1534-
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED,
1535-
MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1534+
obj->setModelConditionFlags( MAKE_MODELCONDITION_MASK2( MODELCONDITION_PARTIALLY_CONSTRUCTED, MODELCONDITION_ACTIVELY_BEING_CONSTRUCTED) );
1535+
1536+
// TheSuperHackers @bugfix Mauller 27/06/2025 we need to deselect the object before setting it as unselectable
1537+
// If the object is set unselectable too soon, it fails to be removed from the selection group
1538+
1539+
// for everybody, unselect them at this time. You can't just deselect a drawable. Selection is a logic property.
1540+
TheGameLogic->deselectObject(obj, PLAYERMASK_ALL, TRUE);
15361541

15371542
//
15381543
// set this object as under de-construction (sold). It is still a legal target, since you get the money at
15391544
// the completion of sale.
15401545
//
15411546
obj->setStatus( MAKE_OBJECT_STATUS_MASK2( OBJECT_STATUS_SOLD, OBJECT_STATUS_UNSELECTABLE ) );
15421547

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

0 commit comments

Comments
 (0)