Jump to content
  • 0

Can't access state.variable in clif function


Mikado

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

Hi all.

I'm writing a small atcommand which changes the view of the party window.

The atcommand reads and writes fine from sd->state.partyview, in clif.c I can access sd->state.partyview inside clif_party_info, howerver, it crashes my mapserver everytime it sends the info to the client.

Just this way:

if(!sd->state.partyview)
{
 memcpy(WBUFP(buf,28+c*46+4), m->name, NAME_LENGTH);
}

It's just the argument in the conditional that crashes my server. Is there any workaround? I just want a variable for every char which I can change through an atcommand.

Thank you.

Edited by Mikado
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  148
  • Reputation:   46
  • Joined:  11/02/11
  • Last Seen:  

When the crash happens is when the conditional is true or false?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  11/08/12
  • Last Seen:  

Both. I've tried with other variables like vending or active, it crashes always.

Edit.

I moved every check to party.c and now it works fine, HOWEVER.

The party status is not updated (or incorrectly update) when:

- People change maps

- People logs in or logs out

- Someone is invited and joins the party

When changing maps (party.c):

/// Invoked (from char-server) when a party member
/// - changes maps
/// - logs in or out
/// - gains a level (disabled)
int party_recv_movemap

In this method I can only check the variable with "p->data.sd->state.partyview" but as it looks like a generic method It's a bit buggy.

Edited by Mikado
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...