2.0.7 RC | error occur while attacking monster

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

Moderators: Moderators, Developers

11768
Noob
Noob
Posts: 2
Joined: 04 Apr 2008, 09:23
Noob?: No
Location: In teh internets.

2.0.7 RC | error occur while attacking monster

#1 Post by 11768 »

Code: Select all

OpenKore version 2.0.7 (Release Candidate) 
@ai_seq = attack
Network state = 5
Network handler = Network::DirectConnection
SVN revision: 6803
No loaded plugins.

Error message:
Invalid arguments.

Stack trace:
Trace begun at src\Task\Route.pm line 80
Task::Route::new('Task::Route', 'x', 0, 'y', 865, 'maxDistance', undef, 'maxTime', 4, 'distFromGoal', undef, 'pyDistFromGoal', undef, 'avoidWalls', '', 'notifyUponArrival', undef) called at src\AI.pm line 506
AI::ai_route('gef_fild13', 0, 865, 'maxRouteTime', 4, 'attackID', '3M-^UM-^N^F', 'noMapRoute', 1, 'noAvoidWalls', 1) called at src\AI\Attack.pm line 543
AI::Attack::main at src\AI\Attack.pm line 97
AI::Attack::process at src\AI\CoreLogic.pm line 77
AI::CoreLogic::iterate at src\functions.pl line 596
main::mainLoop_initialized at src\functions.pl line 70
main::mainLoop at src\Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x3021a38)') called at openkore.pl line 96
main::__start at start.pl line 119

Died at this line:
  
* 	if ($args{x} == 0 || $args{y} == 0) {
  		ArgumentException->throw(error => "Invalid arguments.");

This error occur once in a while when attacking monster. Do tell me if more information are needed.
Scarya
Moderators
Moderators
Posts: 136
Joined: 26 May 2008, 12:25
Noob?: No

Re: 2.0.7 RC | error occur while attacking monster

#2 Post by Scarya »

If I remember correctly I reported this once too...

Code: Select all

	if ($args{x} == 0 || $args{y} == 0) {
		$args{x} = 50;
		$args{y} = 50;
		#ArgumentException->throw(error => "Invalid arguments.");
	}
Use this as a workaround. (This isn't a fix but the error won't occur anymore)

EDIT: found old topic: http://forums.openkore.com/viewtopic.ph ... B&start=10
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the universe trying to produce bigger and better idiots.
So far, the universe is winning.

Richard Cook

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

Re: 2.0.7 RC | error occur while attacking monster

#3 Post by kLabMouse »

Do Developers took a close look on this one?
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: 2.0.7 RC | error occur while attacking monster

#4 Post by EternalHarvest »

Need debug output.

Maybe a problem with meetingPosition.
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: 2.0.7 RC | error occur while attacking monster

#5 Post by Technology »

Kore is routing to an actor that is supposedly on the tile with these coordinates.
'x', 0, 'y', 865
Looking at the 865 value, I'm positive that this "error" is caused by wrongly parsed actor packets.
(another possibility is that a server sends us packets with wrong coordinates to confuse kore)
And yea:

Code: Select all

if ($args{x} == 0 || $args{y} == 0) {
     ArgumentException->throw(error => "Invalid arguments.");
}
Now, lets question what this code above is actually for...
Because, it is possible that a map has tiles with x or y coordinate 0 as walkable!!! (its not very likely, but you get it...)
If this error is thrown to detect bad actor packet parsing, then that's one heck of a bad method to do so lol. :)

If this is all there is to it, then I say, we remove the error throwing or maybe replace it with a warning.
But it would be even better to check if coordinates exist on a map when we receive the actor packets and warn the user there instead when we get unreal coordinates.

Instead of patching the wounded kore, wouldn't it be better if we kept it from being injured in the first place?
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: 2.0.7 RC | error occur while attacking monster

#6 Post by Technology »

in r7017 we will remove actors with such unreal coordinates and warn the user.
# Remove actors that are located on unwalkable parts of the map (or outside)
# This may be caused by:
# - server sending us unreal actors
# - actor packets not being parsed correctly
note:
- actor packets not being parsed correctly is tricky, but at least we will be able to track this more easily now.
- this fix might not solve all causes for the error to trigger


EDIT:
this is caused by wrongly parsed actor packets, which we can fix,
but using a wrong serverType can still cause this, stupidity cannot be healed :P
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!