2025-07-27 14:10 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000989Spring engineGeneralpublic2012-06-27 02:29
ReporterEvil4Zerggin 
Assigned Toabma 
PrioritynormalSeveritytweakReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000989: [patch] Selection Keys Based On Tags, Not Categories
DescriptionThread:

http://spring.clan-sy.com/phpbb/viewtopic.php?f=21&t=15648

Makes SelectionKeyHandler look at the isCommander and canfly unit definition tags to determine if a unit is a commander or aircraft, instead of looking at the unit's category. Please check forum topic for discussion and patch for correctness.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon TagBasedSelectionKeys.patch (1,013 bytes) 2008-07-28 15:38 -
    Index: SelectionKeyHandler.cpp
    ===================================================================
    --- SelectionKeyHandler.cpp	(revision 6216)
    +++ SelectionKeyHandler.cpp	(working copy)
    @@ -256,12 +256,10 @@
     				}
     			}
     		} else if(s=="Commander"){
    -			unsigned int comCat=CCategoryHandler::Instance()->GetCategory("COMMANDER");
    -
     			std::list<CUnit*>::iterator ui=selection.begin();
     			while (ui!=selection.end()) {
     				bool filterTrue=false;
    -				if ((*ui)->category & comCat){	//fix with better test for commander
    +				if((*ui)->unitDef->isCommander){
     					filterTrue=true;
     				}
     				if (filterTrue ^ _not) {
    @@ -286,12 +284,11 @@
     				}
     			}
     		} else if(s=="Aircraft"){
    -			unsigned int acCat=CCategoryHandler::Instance()->GetCategory("VTOL");
     
     			std::list<CUnit*>::iterator ui=selection.begin();
     			while (ui != selection.end()) {
     				bool filterTrue=false;
    -				if ((*ui)->category & acCat){
    +				if ((*ui)->unitDef->canfly){
     					filterTrue=true;
     				}
     				if (filterTrue ^ _not) {
    
    patch file icon TagBasedSelectionKeys.patch (1,013 bytes) 2008-07-28 15:38 +

-Relationships
+Relationships

-Notes

~0002441

imbaczek (reporter)

committed in r6220, thanks.
+Notes

-Issue History
Date Modified Username Field Change
2008-07-28 15:38 Evil4Zerggin New Issue
2008-07-28 15:38 Evil4Zerggin File Added: TagBasedSelectionKeys.patch
2008-07-30 14:05 imbaczek Note Added: 0002441
2008-07-30 14:05 imbaczek Status new => resolved
2008-07-30 14:05 imbaczek Resolution open => fixed
2012-06-27 02:27 abma Status resolved => assigned
2012-06-27 02:27 abma Assigned To => abma
2012-06-27 02:29 abma Status assigned => resolved
+Issue History