Skip to content

Commit 223dae3

Browse files
revert kill_xp updates removal to preserve functionality of in-repo mods
1 parent f50f8da commit 223dae3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/kill_tracker.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ static Character *get_avatar_or_follower( const character_id &id )
104104
return nullptr;
105105
}
106106

107+
// Legacy value, maintained until kill_xp rework/removal from dependent in-repo mods
108+
static constexpr int npc_kill_xp = 10;
109+
107110
void kill_tracker::notify( const cata::event &e )
108111
{
109112
switch( e.type() ) {
@@ -112,6 +115,8 @@ void kill_tracker::notify( const cata::event &e )
112115
if( Character *killer = get_avatar_or_follower( killer_id ) ) {
113116
const mtype_id victim_type = e.get<mtype_id>( "victim_type" );
114117
kills[victim_type]++;
118+
// Legacy value update, maintained until kill_xp rework/removal from dependent in-repo mods
119+
killer->kill_xp += e.get<int>( "exp" );
115120
victim_type.obj().families.practice_kill( *killer );
116121
}
117122
break;
@@ -122,6 +127,8 @@ void kill_tracker::notify( const cata::event &e )
122127
if( get_avatar_or_follower( killer_id ) ) {
123128
const std::string victim_name = e.get<cata_variant_type::string>( "victim_name" );
124129
npc_kills.push_back( victim_name );
130+
// Legacy value update, maintained until kill_xp rework/removal from dependent in-repo mods
131+
killer->kill_xp += npc_kill_xp;
125132
}
126133
break;
127134
}

0 commit comments

Comments
 (0)