[DONE] CP Regen Code

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
brutus
Posts: 325
Joined: Sat Nov 10, 2007 4:18 pm
Location: Bulgaria

[DONE] CP Regen Code

Post 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
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: CP Regen Code

Post by Zoey76 »

Interesting, I'll have to check it.
Powered by Eclipse 4.30 ๐ŸŒŒ | Eclipse Temurin 21 โ˜• | MariaDB 11.3.2 ๐Ÿ—ƒ๏ธ | L2J Server 2.6.3.0 - High Five ๐Ÿš€

๐Ÿ”— Join our Discord! ๐ŸŽฎ๐Ÿ’ฌ
User avatar
Bencratus
Posts: 51
Joined: Wed Jan 07, 2015 11:38 pm
Contact:

Re: CP Regen Code

Post by Bencratus »

Checked, the else part is useless:D
User avatar
brutus
Posts: 325
Joined: Sat Nov 10, 2007 4:18 pm
Location: Bulgaria

Re: CP Regen Code

Post 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
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: CP Regen Code

Post by Zoey76 »

Refactored in [commit]aafc5913d5a485a003480f381d5e043a11833750[/commit], thanks :P
Powered by Eclipse 4.30 ๐ŸŒŒ | Eclipse Temurin 21 โ˜• | MariaDB 11.3.2 ๐Ÿ—ƒ๏ธ | L2J Server 2.6.3.0 - High Five ๐Ÿš€

๐Ÿ”— Join our Discord! ๐ŸŽฎ๐Ÿ’ฌ
Post Reply