Page 1 of 1

[DONE] CP Regen Code

Posted: Thu Feb 12, 2015 3:17 am
by brutus
i was messing up around and saw something kinda weird code in formulas.java calcCpRegen(L2Character cha) and it was
if (cha.isPlayer())
{
// code
}
else
{
// ?? what that part does?
}

whats the logic of that? cuz i dont see
the method itself is just for L2PcInstance and cannot be used by antoher instance so it can be improved as code

Re: CP Regen Code

Posted: Fri Feb 13, 2015 4:12 am
by Zoey76
Interesting, I'll have to check it.

Re: CP Regen Code

Posted: Fri Feb 13, 2015 3:30 pm
by Bencratus
Checked, the else part is useless:D

Re: CP Regen Code

Posted: Fri Feb 13, 2015 10:10 pm
by brutus
as i though ;d afaik cp is used only by player instances and even the parameter l2character must be l2pcinstance and the entire cpreg method could be optimized

Re: CP Regen Code

Posted: Sun Feb 15, 2015 1:42 am
by Zoey76
Refactored in [commit]aafc5913d5a485a003480f381d5e043a11833750[/commit], thanks :P