Skip to content

Commit 6243b50

Browse files
authored
Close revival loophole for monster training limits (#82141)
2 parents 4da43d7 + 996f707 commit 6243b50

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/game.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5764,6 +5764,10 @@ bool game::revive_corpse( const tripoint_bub_ms &p, item &it, int radius )
57645764
}
57655765
}
57665766

5767+
if( it.get_var( "times_combatted", 0.0 ) > 0.0 ) {
5768+
critter.times_combatted_player = it.get_var( "times_combatted", 0.0 );
5769+
}
5770+
57675771
return place_critter_around( newmon_ptr, tripoint_bub_ms( p ), radius );
57685772
}
57695773

src/mondeath.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,8 @@ item_location make_mon_corpse( map *here, monster &z, int damageLvl )
291291
if( !z.has_eaten_enough() ) {
292292
corpse.set_flag( json_flag_UNDERFED );
293293
}
294+
if( z.times_combatted_player ) {
295+
corpse.set_var( "times_combatted", z.times_combatted_player );
296+
}
294297
return here->add_item_or_charges_ret_loc( z.pos_bub( *here ), corpse );
295298
}

0 commit comments

Comments
 (0)