Issue information

Issue ID
#6274
Status
Invalid
Severity
None
Started
Hercules Elf Bot
Jul 19, 2012 12:47
Last Post
Hercules Elf Bot
Jul 20, 2012 5:39
Confirmation
N/A

Hercules Elf Bot - Jul 19, 2012 12:47

Originally posted by [b]Lemongrass[/b]
Due to revision 16466 the performance was improved a little bit to much.
[url="http://trac.rathena.org/changeset/16446/rathena"]http://trac.rathena.org/changeset/16446/rathena[/url]
so much that the homunculus battle logic is skipped from now on.


i don't know whether that's important or not but you should stack on validating the BL type with a binary AND.

additionally you lost the homunculus part of the logic.

i think this should fix it
[code]
if ( s_bl->type & BL_PC ) {
switch( t_bl->type ) {
case BL_MOB: // Source => PC, Target => MOB
if ( pc_has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVM) )
return 0;
break;
case BL_PC: // Source => PC, Target => PC
if (pc_has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVP))
return 0;
break;
default:/* anything else goes */
break;
}
}else if( s_bl->type & BL_HOM ){
struct homun_data *hd = (TBL_HOM*)src;

if (hd != NULL && hd->master->bl != NULL ){
switch( t_bl->type ) {
case BL_MOB: // Source => HOM, Target => MOB
if ( pc_has_permission((TBL_PC*)hd->master->bl, PC_PERM_DISABLE_PVM) )
return 0;
break;
case BL_PC: // Source => HOM, Target => PC
if (pc_has_permission((TBL_PC*)hd->master->bl, PC_PERM_DISABLE_PVP))
return 0;
break;
default:/* anything else goes */
break;
}
}
}
[/code]

This post has been edited by Lemongrass on Jul 19, 2012 12:48

Hercules Elf Bot - Jul 19, 2012 18:10

Originally posted by [b]Ind[/b]
you're wrong. s_bl will never be BL_HOM because BL_HOM is always a summon of something which will make s_bl be BL_PC, which makes the commit work as intended.

Hercules Elf Bot - Jul 19, 2012 18:25

Originally posted by [b]Lemongrass[/b]
sorry it's not s_bl but src... copy paste issue. as you can see in the changeset the code for the homunculi was removed or was this intended?
if it can't be a BL_HOM why was it checked there in the first place?

[edit]:
just saw that s_bl = src. wtf?
if this code was removed intentionally then just forget about this issue, for me it seemed rather than this was unintended since it was checked before.

This post has been edited by Lemongrass on Jul 19, 2012 18:28

Hercules Elf Bot - Jul 20, 2012 5:39

Originally posted by [b]malufett[/b]
sir Ind is correct..
s_bl will be never be a BL_HOM..because s_bl holds the master where it is the BL_PC

look at this[CODE]
if( (s_bl = battle_get_master(src)) == NULL )
s_bl = src;
[/CODE]

BL_HOM cannot be a master of another BL_HOM