pan 87 Posted December 31, 2013 Hello, lately I was reading Hercules' source-code and I've noticed that there are many functions that are defined as 'int' types but are constant, they're returning only one value. Look for instance at pc_bonus it returns 0 in all possible inputs... I guess that functions like this should return whether they were successful or not, otherwise there's no way to handle exceptions like if there was an incorrect input. For instance pc_bonus should be defined as 'bool' instead of 'int' and return whether it was successful or not, I'm sure that there're many functions that are defined "incorrectly" as well. Hope I've helped, Pan. Quote Share this post Link to post Share on other sites
pan 87 Posted January 4, 2014 Only 49 views ): Bump Quote Share this post Link to post Share on other sites
Ind 945 Posted January 14, 2014 yup, there are also many whose return value is irrelevant (e.g. timers), we haven't prioritised this kind of cleanup though (we usually fix those we pass by) 1 pan reacted to this Quote Share this post Link to post Share on other sites
pan 87 Posted January 14, 2014 (edited) Thank you for your attention c:I've made some changes and modified some files, I already made a pull request: https://github.com/HerculesWS/Hercules/pull/251 Edited January 14, 2014 by Mhalicot Post Merged. Quote Share this post Link to post Share on other sites