Jump to content
  • 0

Why is this crashing my map server?


michaelsoftman

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  410
  • Reputation:   29
  • Joined:  04/04/12
  • Last Seen:  

I have changed this part of skill.c. From this:

if(fixed == 0) {
 fixed = (int)time * 20 / 100; // fixed time
 time = time * 80 / 100; // variable time
}
else if( fixed == 0 ) {
 fixed = 0;
}

To this:

if( fixed == 0 && sd->class_&JOBL_THIRD){
 fixed = (int)time * 20 / 100; // fixed time
 time = time * 80 / 100; // variable time
}
if (!sd->class_&JOBL_THIRD) {// no fixed cast time
 fixed = 0;
}

And then when I boot up the server, the map server crashes as soon as the char server connects. But I do not get any compile errors or warnings. Any idea why?

Edited by michaelsoftman
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

cause not only sd use that fonction I suppose.

I should check but that my raw guess, you can validate it with the coredump.

Try to add another if case for class_

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

You introduced sd->class_&JOBL_THIRD, the right way would be to check first if sd is not NULL.

thus,

if( fixed == 0 && sd && sd->class_&JOBL_THIRD){

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

na but he shouldn't do that since mob/homon etc won't ever enter here then and won't be concern.

(dunno who enter atm you need to test, but maybe that what u want yeah)

otherwise jsut add :

if(sd) blablabla;

else if blabla

else foo;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  410
  • Reputation:   29
  • Joined:  04/04/12
  • Last Seen:  

You introduced sd->class_&JOBL_THIRD, the right way would be to check first if sd is not NULL.

thus,

if( fixed == 0 && sd && sd->class_&JOBL_THIRD){

Thanks a lot, it's working perfectly now!

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...