@@ -147,6 +147,7 @@ void SetAllyData(ClientPlayerAvatar clientPlayerAvatar)
147147
148148 ulong id = serverCharacter . NetworkObjectId ;
149149 int slot = FindOrAddAlly ( id ) ;
150+
150151 // do nothing if not in a slot
151152 if ( slot == - 1 )
152153 {
@@ -187,18 +188,21 @@ void SetUIFromSlotData(int slot, ServerCharacter serverCharacter)
187188 void SetAllyGodModeStatus ( ulong id , bool newValue )
188189 {
189190 int slot = FindOrAddAlly ( id , true ) ;
191+
190192 // do nothing if not in a slot
191193 if ( slot == - 1 )
192194 {
193195 return ;
194196 }
197+
195198 m_PartyHealthGodModeImages [ slot ] . gameObject . SetActive ( newValue ) ;
196199 }
197200#endif
198201
199202 void SetAllyHealth ( ulong id , int hp )
200203 {
201204 int slot = FindOrAddAlly ( id , true ) ;
205+
202206 // do nothing if not in a slot
203207 if ( slot == - 1 )
204208 {
@@ -260,7 +264,7 @@ int FindOrAddAlly(ulong id, bool dontAdd = false)
260264 // special case: id of 0 is uninitialized party id
261265 return - 1 ;
262266 }
263-
267+
264268 int openslot = - 1 ;
265269 for ( int i = 0 ; i < m_PartyIds . Length ; i ++ )
266270 {
@@ -269,6 +273,7 @@ int FindOrAddAlly(ulong id, bool dontAdd = false)
269273 {
270274 return i ;
271275 }
276+
272277 // otherwise, record the first open slot (not slot 0 thats for the Hero)
273278 if ( openslot == - 1 && i > 0 && m_PartyIds [ i ] == 0 )
274279 {
@@ -284,6 +289,7 @@ int FindOrAddAlly(ulong id, bool dontAdd = false)
284289 {
285290 // activeate the correct ally panel
286291 m_AllyPanel [ openslot - 1 ] . SetActive ( true ) ;
292+
287293 // and save ally ID to party array
288294 m_PartyIds [ openslot ] = id ;
289295 return openslot ;
@@ -314,13 +320,14 @@ void RemoveAlly(ulong id)
314320 {
315321 // remove potential selected state of party member UI
316322 SetHeroSelectFX ( id , false ) ;
317-
323+
318324 for ( int i = 0 ; i < m_PartyIds . Length ; i ++ )
319325 {
320326 // if this ID is in the list, return the slot index
321327 if ( m_PartyIds [ i ] == id )
322328 {
323329 m_AllyPanel [ i - 1 ] . SetActive ( false ) ;
330+
324331 // and save ally ID to party array
325332 m_PartyIds [ i ] = 0 ;
326333 }
0 commit comments