Jump to content
  • 0

@speed bug


Kreustoo

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

Hi,

Well, I have some probleme with my @speed commande and I really don't understand why : when I @speed someone, when his speed is recaculate => it becomes 0.

So, for some event you want to slow the player, they unequip a item => they are like flash.

 

(I tryed some things, so I think it's easier to read with some spoiler, you can have a resume just reading the tilte.)
1) Changing status_calc_pc_ 


I'm in the last SVN and I decided to understand how it could happen, I saw the beuatifull diea of permanent_speed and this in status.c : function : status_calc_pc_ :

 

//FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex]
	if (!sd->state.permanent_speed)
		status->speed = DEFAULT_WALK_SPEED;
 

 

And I changed to a previous version :

//FIXME: Most of these stuff should be calculated once, but how do I fix the memset above to do that? [Skotlex]
		status->speed = DEFAULT_WALK_SPEED;

Now, it automatically go to the default_walk_speed on unequip/change map/level up ect, which is quite logical.


=> I replaced the test where it should be.

 

2) Changing status_calc_speed


So I searched somewhere else with a test like if(sd->state.permanent_speed) and there is only another :
 

	if (sd && sd->state.permanent_speed)
		return (short)cap_value(speed,10,USHRT_MAX);

I tryed to del it, nothing happened IG => always max speed up after unequip a item.

 

3) Trying another thing in status_calc_pc_ 

Well, so, I replaced it and tryed this :

	if (!sd->state.permanent_speed)
		status->speed = DEFAULT_WALK_SPEED;
	else
		status->speed = 500;

One more time, obvisouly, I go to slow motion when I use speed and unequip a item.

Let's try this :

	if (!sd->state.permanent_speed)
		status->speed = DEFAULT_WALK_SPEED;
	else
		status->speed = sd->base_status.speed;

And it change nothing, cause :
 

status = &sd->base_status;

status is pointing on the player speed already !



So, I don't understand why my speed is already fucked up before going into status_calc_pc_ :/.

 

4) Retard mode in speed atcommand


Well, I'm going to full retard mode :
 

	if (speed < 0) {
		sd->base_status.speed = DEFAULT_WALK_SPEED;
		sd->state.permanent_speed = 0; // Remove lock when set back to default speed.
	} else {
		sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED);
		sd->state.permanent_speed = 1; // Set lock when set to non-default speed.
	}

=>


	if (speed < 0) {
		sd->base_status.speed = DEFAULT_WALK_SPEED;
		sd->state.permanent_speed = 0; // Remove lock when set back to default speed.
	} else {
		sd->base_status.speed = 500;
		sd->state.permanent_speed = 1; // Set lock when set to non-default speed.
	}

Slow motion, but still hyper fast on unequip...

 

5) Changing status_change_start to know if it's this function that fuck up my speed

		if( bl->type&BL_PC && status->speed < battle_config.max_walk_speed )
			status->speed = battle_config.max_walk_speed;

To :
 

		if( bl->type&BL_PC && status->speed < battle_config.max_walk_speed )
			status->speed = 500;

To be perfectly honnest, I really didn't know what would happen there, so IG :
-When I speed 1 I go to 500
-When I speed 100 I go to 100

Woot ?

 

Let's try this :
 

		if(( bl->type&BL_PC && status->speed < battle_config.max_walk_speed )&&(!sd->state.permanent_speed))
			status->speed = battle_config.max_walk_speed;

Ultra speed mode unlocked, I'm nearly teleporting where I want to go.



So it seems there is something with this function, but, I don't really understand what is happening there, so, maybe, I'm just totally wrong.

 

 

6) Changing status_change_start in retard mode


Well : retard mode :

if(flag&SCB_SPEED) {
		struct unit_data *ud = unit_bl2ud(bl);
		//status->speed = status_calc_speed(bl, sc, b_status->speed);

 

Let's randomly quote this => hypersonic mode teleporting

Okaayyy, so, the prob is maybe in status_calc_speed... Which is my 2nd test... I tryed some weird things like this :

	if(flag&SCB_SPEED) {
		struct unit_data *ud = unit_bl2ud(bl);
		status->speed = status_calc_speed(bl, sc, 300);

which is jsut resulting on a perma 300, obvisouly.



Well, to conclude, I really don't understand, I made a perfect circle, and I gave you nearly all the things I tryed to exclude some idea and to prove that I really tryed myself.

If someone can help me :/.
 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  215
  • Reputation:   45
  • Joined:  05/03/13
  • Last Seen:  

Nobody experimented that kind of problem :/ ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

If you think this is a bug. Kindly post it in our bug tracker :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...