From 8f1cb9748c98600be1643d3130556a0d942f7dda Mon Sep 17 00:00:00 2001 From: Ryan Sullivant Date: Tue, 5 May 2020 11:44:46 -0700 Subject: [PATCH] Remove unnecesaary comments and update PLAYER_ACTIVITY.doc to mention activity_actor::can_resume_with_internal --- doc/PLAYER_ACTIVITY.md | 3 ++- src/activity_actor.cpp | 2 -- src/player_activity.cpp | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/doc/PLAYER_ACTIVITY.md b/doc/PLAYER_ACTIVITY.md index 99603efef7ca5..3ad0ec330d103 100644 --- a/doc/PLAYER_ACTIVITY.md +++ b/doc/PLAYER_ACTIVITY.md @@ -20,7 +20,8 @@ functions. Don't forget to add the deserialization function of your new activity actor to the `deserialize_functions` map towards the bottom of `activity_actor.cpp`. -4. `player_activity.cpp` Optionally update `can_resume_with`. +4. If this activity is resumable, `override` +`activity_actor::can_resume_with_internal` 5. Construct your activity actor and then pass it to the constructor for `player_activity`. The newly constructed activity can then be assigned diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index 02a9d8349e8ed..75b6f41f3163c 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -168,8 +168,6 @@ void dig_channel_activity_actor::finish( player_activity &act, Character &who ) calendar::turn ) ); } - //TODO: Should we consider helpers like in dig_activity_actor::finish? - // And should we use mod_stored_nutr instead of mod_hunger? who.mod_hunger( 5 ); who.mod_thirst( 5 ); who.mod_fatigue( 10 ); diff --git a/src/player_activity.cpp b/src/player_activity.cpp index 581e0c6b65da2..562cc7a7db085 100644 --- a/src/player_activity.cpp +++ b/src/player_activity.cpp @@ -149,7 +149,6 @@ cata::optional player_activity::get_progress_message( const avatar type == activity_id( "ACT_CHOP_LOGS" ) || type == activity_id( "ACT_CHOP_PLANKS" ) ) { - const int percentage = ( ( moves_total - moves_left ) * 100 ) / moves_total; extra_info = string_format( "%d%%", percentage ); @@ -298,9 +297,6 @@ bool player_activity::can_resume_with( const player_activity &other, const Chara // Should be used for relative positions // And to forbid resuming now-invalid crafting - // TODO: Once activity_handler_actors exist, the less ugly method of using a - // pure virtual can_resume_with should be used - if( !*this || !other || type->no_resume() ) { return false; }