1
- using System . Linq ;
2
1
using System . Text ;
3
2
using Content . Server . _CorvaxNext . VoxRaiders . Components ;
4
3
using Content . Server . Antag ;
@@ -63,7 +62,7 @@ protected override void AppendRoundEndText(EntityUid uid, VoxRaidersRuleComponen
63
62
if ( objectives . Count < 1 )
64
63
continue ;
65
64
66
- var info = _objectives . GetInfo ( objectives [ 0 ] . Objective , objectives [ 0 ] . Mind , objectives [ 0 ] . Mind ) ;
65
+ var info = _objectives . GetInfo ( objectives [ 0 ] . Objective , objectives [ 0 ] . Mind ) ;
67
66
68
67
if ( info is null )
69
68
continue ;
@@ -81,6 +80,8 @@ private void OnAfterAntagEntitySelected(Entity<VoxRaidersRuleComponent> entity,
81
80
if ( mind is null )
82
81
return ;
83
82
83
+ entity . Comp . Raiders . Add ( e . EntityUid ) ;
84
+
84
85
var query = AllEntityQuery < VoxRaidersShuttleComponent , ExtractionShuttleComponent > ( ) ;
85
86
while ( query . MoveNext ( out var shuttle , out var extraction ) )
86
87
if ( shuttle . Rule == entity . Owner )
@@ -98,7 +99,7 @@ private void OnAfterAntagEntitySelected(Entity<VoxRaidersRuleComponent> entity,
98
99
99
100
_mind . AddObjective ( mind . Value , mindComponent , obj . Value ) ;
100
101
101
- entity . Comp . Objectives . GetOrNew ( objective ) . Add ( ( obj . Value , ( mind . Value , mindComponent ) ) ) ;
102
+ entity . Comp . Objectives . GetOrNew ( objective ) . Add ( ( obj . Value , mind . Value ) ) ;
102
103
}
103
104
}
104
105
@@ -136,10 +137,19 @@ private void OnFTLCompleted(Entity<VoxRaidersShuttleComponent> entity, ref FTLCo
136
137
return ;
137
138
138
139
foreach ( var objectives in rule . Objectives . Values )
139
- if ( ! objectives . All ( objective => _objectives . IsCompleted ( objective . Objective , objective . Mind ) ) )
140
+ foreach ( var objective in objectives )
141
+ if ( TryComp < MindComponent > ( objective . Mind , out var mind ) )
142
+ if ( ! _objectives . IsCompleted ( objective . Objective , ( objective . Mind , mind ) ) )
143
+ return ;
144
+
145
+ foreach ( var raider in rule . Raiders )
146
+ {
147
+ if ( ! TryComp < ExtractionShuttleComponent > ( Transform ( raider ) . GridUid , out var shuttle ) )
140
148
return ;
141
149
142
- Del ( e . MapUid ) ;
150
+ if ( ! shuttle . Owners . Contains ( raider ) )
151
+ return ;
152
+ }
143
153
144
154
rule . Success = true ;
145
155
}
0 commit comments