Found a small bug

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Found a small bug

#1 Post by BlubBlab » Fri Nov 27, 2015 9:53 am

I found something odd

In camera.lua

Code: Select all

  local proc = getProc();
  local memerrmsg = "Failed to read memory";
  self.XUVec = debugAssert(memoryReadFloat(proc, self.Address + camXUVec_offset), memerrmsg);
  self.YUVec = debugAssert(memoryReadFloat(proc, self.Address + camYUVec_offset), memerrmsg);
  self.ZUVec = debugAssert(memoryReadFloat(proc, self.Address + camZUVec_offset), memerrmsg);
  .
I wondered what the debugAssert function is :

Code: Select all

if(settings.options.DEBUGGING == nil ) then settings.options.DEBUGGING = false; end;
function debugAssert(args)
	if( settings.options.DEBUGGING ) then
		if( not args ) then
			error("Error in memory reading", 2);
		else
			return args;
		end
	else
		return args;
	end
end
If you don't see it the numbers of arguments don't match. For me it looks like either the error message should be optional or since it is a assert, "Failed to read memory" was originally expected as return value so you could assert against it but I would as return value more true or false expecting rather then the result... so no clue ?

I think I will add debug options to my InputOutput class but not like this.^^ (hm I still wonder if I should use Lisa's logger?)
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

Post Reply

Who is online

Users browsing this forum: No registered users and 54 guests