| 1058 | } |
| 1059 | |
| 1060 | static AIGroup* GetUnits(const GameState* state, GameValuePar oper1, PackedBoolArray& list) |
| 1061 | { |
| 1062 | if (oper1.GetType() == GameObject) |
| 1063 | { |
| 1064 | AIUnit* unit = GetUnit(state, oper1); |
| 1065 | if (!unit) |
| 1066 | { |
| 1067 | return nullptr; |
| 1068 | } |
| 1069 | AIGroup* grp = unit->GetGroup(); |
| 1070 | if (!grp) |
| 1071 | { |
| 1072 | return nullptr; |
| 1073 | } |
| 1074 | list.Set(unit->ID() - 1, true); |
| 1075 | return grp; |
| 1076 | } |
| 1077 | else |
| 1078 | { |
| 1079 | const GameArrayType& array = oper1; |
| 1080 | AIGroup* grp = nullptr; |
| 1081 | for (int i = 0; i < array.Size(); i++) |
| 1082 | { |
| 1083 | AIUnit* unit = GetUnit(state, array[i]); |
| 1084 | if (!unit) |
| 1085 | { |
| 1086 | continue; |
| 1087 | } |
| 1088 | AIGroup* g = unit->GetGroup(); |
| 1089 | if (!g) |
| 1090 | { |
| 1091 | continue; |
| 1092 | } |
| 1093 | if (grp && g != grp) |
| 1094 | { |
| 1095 | continue; // different group |
| 1096 | } |
| 1097 | grp = g; |
| 1098 | list.Set(unit->ID() - 1, true); |
| 1099 | } |
| 1100 | return grp; |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | GameValue VehDone(const GameState* state, GameValuePar oper1) |
| 1105 | { |
no test coverage detected