@@ -3075,37 +3075,37 @@ void DebriefingState::recoverItems(std::vector<BattleItem*> *from, Base *base, C
30753075 else
30763076 {
30773077
3078- // coop fix
3079- if (!bi->getUnit ())
3080- {
3081- continue ;
3082- }
3083-
30843078 if (rule->isRecoverable () && !bi->getXCOMProperty ())
30853079 {
30863080 if (rule->getBattleType () == BT_CORPSE)
30873081 {
3088- BattleUnit *corpseUnit = bi->getUnit ();
3089- if (corpseUnit->getStatus () == STATUS_DEAD)
3082+
3083+ // coop fix
3084+ if (bi->getUnit ())
30903085 {
3091- if (rule->isCorpseRecoverable ())
3086+ BattleUnit* corpseUnit = bi->getUnit ();
3087+ if (corpseUnit->getStatus () == STATUS_DEAD)
30923088 {
3093- addItemsToBaseStores (corpseUnit->getArmor ()->getCorpseGeoscape (), base, 1 , true );
3094- addStat (" STR_ALIEN_CORPSES_RECOVERED" , 1 , bi->getRules ()->getRecoveryPoints ());
3089+ if (rule->isCorpseRecoverable ())
3090+ {
3091+ addItemsToBaseStores (corpseUnit->getArmor ()->getCorpseGeoscape (), base, 1 , true );
3092+ addStat (" STR_ALIEN_CORPSES_RECOVERED" , 1 , bi->getRules ()->getRecoveryPoints ());
3093+ }
30953094 }
3096- }
3097- else if (corpseUnit->getStatus () == STATUS_UNCONSCIOUS ||
3098- // or it's in timeout because it's unconscious from the previous stage
3099- // units can be in timeout and alive, and we assume they flee.
3100- (corpseUnit->isIgnored () &&
3101- corpseUnit->getHealth () > 0 &&
3102- corpseUnit->getHealth () < corpseUnit->getStunlevel ()))
3103- {
3104- if (corpseUnit->getOriginalFaction () == FACTION_HOSTILE)
3095+ else if (corpseUnit->getStatus () == STATUS_UNCONSCIOUS ||
3096+ // or it's in timeout because it's unconscious from the previous stage
3097+ // units can be in timeout and alive, and we assume they flee.
3098+ (corpseUnit->isIgnored () &&
3099+ corpseUnit->getHealth () > 0 &&
3100+ corpseUnit->getHealth () < corpseUnit->getStunlevel ()))
31053101 {
3106- recoverAlien (corpseUnit, base, craft);
3102+ if (corpseUnit->getOriginalFaction () == FACTION_HOSTILE)
3103+ {
3104+ recoverAlien (corpseUnit, base, craft);
3105+ }
31073106 }
31083107 }
3108+
31093109 }
31103110 // only add recovery points for unresearched items
31113111 else if (!_game->getSavedGame ()->isResearched (rule->getRequirements ()))
0 commit comments