Undefined $player in checkPlayerCondition

This place is for Closed bug reports only. NOT for asking help!

Moderators: Moderators, Developers

Message
Author
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Undefined $player in checkPlayerCondition

#1 Post by EternalHarvest »

Code: Select all

SVN revision: 7367

Error message:
Can't call method "statusActive" on an undefined value at src/Misc.pm line 3872.

Stack trace:
Can't call method "statusActive" on an undefined value at src/Misc.pm line 3872.
 at src/Misc.pm line 3871
	Misc::checkPlayerCondition('partySkill_4_target', '****') called at src/AI/CoreLogic.pm line 2414
	AI::CoreLogic::processPartySkillUse() called at src/AI/CoreLogic.pm line 164
	AI::CoreLogic::iterate() called at src/functions.pl line 749
	main::mainLoop_initialized() called at src/functions.pl line 69
	main::mainLoop() called at src/Interface.pm line 75
	Interface::mainLoop('Interface::Console::Simple=HASH(0x86c3868)') called at ./openkore.pl line 97
	main::__start() called at ./openkore.pl line 187

Died at this line:
  	if ($config{$prefix . "_whenStatusInactive"}) {
* 		return 0 if $player->statusActive($config{$prefix . "_whenStatusInactive"});
  	}
That's probably because checkPlayerCondition looks only for players and party, and doesn't check if it exists:

Code: Select all

my $player = $playersList->getByID($id) || $slavesList->getByID($id);
when processPartySkillUse also processes the character:

Code: Select all

foreach my $ID ($accountID, @slavesID, @playersID) {
Actually doesn't happen unless you mess with party skills logic.

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: Undefined $player in checkPlayerCondition

#2 Post by kLabMouse »

Fixed in r7494

Locked