Page 1 of 1

Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 5:20 pm
by Zilvermoon
I have noticed that when I move through areas with hostile mobs my character will continue to move even though the player:Battling() flag is activated, this isn't a real issue in most places, but if you farm elites it is a big deal, so here is a fix:

player.lua line 644 - 663

Code: Select all

		self:update();
		if( self.Battling and not self:haveTarget() ) then
			cprintf(cli.green, language[35]);
			keyboardRelease( settings.hotkeys.MOVE_FORWARD.key );
			local aggroWaitStart = os.time();
			while(self.Battling) do
				if( player:haveTarget() ) then
					break;
				end;

				if( os.difftime(os.time(), aggroWaitStart) > 3 ) then
					cprintf(cli.red, language[34]);
					break;
				end;

				yrest(10);
				player:update();
			end
		end

It's working like a charm for me, but then again i have only had a little bit of testing with it ... so if you wanna use pleases feel free to do so :)

Zilvermoon

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 5:25 pm
by d003232
Zilvermoon wrote:I have noticed that when I move through areas with hostile mobs my character will continue to move even though the player:Battling() flag is activated, this isn't a real issue in most places, but if you farm elites it is a big deal, so here is a fix:
Ähm Ähm Ähm, SVN 89 from a couple days before has that function within.

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 5:43 pm
by Zilvermoon
d003232 wrote:
Zilvermoon wrote:I have noticed that when I move through areas with hostile mobs my character will continue to move even though the player:Battling() flag is activated, this isn't a real issue in most places, but if you farm elites it is a big deal, so here is a fix:
Ähm Ähm Ähm, SVN 89 from a couple days before has that function within.
lol sorry didn't update my version before farming tonight ... :o

Zilvermoon

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 6:53 pm
by Zilvermoon
Ok your code is great, but you didn't take into account that the function also is used for moving towards a mob, which is making a great mess out of it, so to fix that edit line 641 in player.lua to:

code:

Code: Select all

	 	if( self.Battling ) then
new code:

Code: Select all

	 	if( self.Battling and not self:haveTarget() ) then
edit: Naa strike that, this isn't really helping ... but something is up ... with the battling code inside movement ... try moving in TRAVEL waypoints in an hostile area and test what I mean ...

Zilvermoon

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 6:57 pm
by d003232
Zilvermoon wrote:Ok your code is great, but you didn't take into account that the function also is used for moving towards a mob, which is making a great mess out of it, so to fix that edit line 641 in player.lua to:

code:

Code: Select all

	 	if( self.Battling ) then
new code:

Code: Select all

	 	if( self.Battling and not self:haveTarget() ) then
Zilvermoon
Dmnd. I only play casters. They don't need to move while battling. :oops:

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 7:00 pm
by Zilvermoon
Too quick for me, did an edit of pre-post.

Naa strike that, this isn't really helping ... but something is up ... with the battling code inside movement ... try moving in TRAVEL waypoints in an hostile area and test what I mean ...

Now I think I got it working like it should, if you would please help test this:

Code: Select all

	 	if( self.Battling and ( self.Fighting == false ) ) then
Zilvermoon

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 7:16 pm
by d003232
Zilvermoon wrote: Now I think I got it working like it should, if you would please help test this:

Code: Select all

	 	if( self.Battling and ( self.Fighting == false ) ) then
Yes, I think self.Fighting check should be the right thing. Now I understand, what's self.Fighting is for! :shock: Do you make the SVN fix?

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 7:27 pm
by Zilvermoon
d003232 wrote:
Zilvermoon wrote: Now I think I got it working like it should, if you would please help test this:

Code: Select all

	 	if( self.Battling and ( self.Fighting == false ) ) then
Yes, I think self.Fighting check should be the right thing. Now I understand, what's self.Fighting is for! :shock: Do you make the SVN fix?
Sure I can do that, just need to pull a few modifications out of my version before SVN update.

Zilvermoon

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 7:30 pm
by d003232
Zilvermoon wrote:Sure I can do that, just need to pull a few modifications out of my version before SVN update.
No, don't do that. It's better just to copy the 'rom' folder to a new name like 'romsvn'. Delete all content within 'romsvn' and do a SVN update at 'romsvn'. Then you have a parallel clear SVN version.

I can also do it tomorrow morning. I nowhave no go to sleep.

Re: Suggestion: Stop moving on player:Battling()

Posted: Sun Jul 26, 2009 7:33 pm
by Zilvermoon
d003232 wrote:
Zilvermoon wrote:Sure I can do that, just need to pull a few modifications out of my version before SVN update.
No, don't do that. It's better just to copy the 'rom' folder to a new name like 'romsvn'. Delete all content within 'romsvn' and do a SVN update at 'romsvn'. Then you have a parallel clear SVN version.
Np, was only one modification, none moving for buff is player.Battling, so I have updated SVN :)

Zilvermoon