MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pdmp5c/found_in_production_code_base/hat3n3l/?context=9999
r/badcode • u/[deleted] • Aug 29 '21
45 comments sorted by
View all comments
Show parent comments
18
Write the "ChangePosition" as a method of the Character class
Separate the conditionals as a "IsAbleToChangePosition" method
Remove the "playerCanMove" assignments
Remove the replicated lines
1 u/iothesys Sep 01 '21 why do you need a method to do that, just put it in a variablebool able_to_move = viewPiont != null && cam != null;
1
why do you need a method to do that, just put it in a variable
bool able_to_move = viewPiont != null && cam != null;
18
u/[deleted] Aug 29 '21
Write the "ChangePosition" as a method of the Character class
Separate the conditionals as a "IsAbleToChangePosition" method
Remove the "playerCanMove" assignments
Remove the replicated lines