diff options
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/script.c b/src/map/script.c index 23c6af0f8..cbbf306d1 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -62,6 +62,7 @@ #endif struct script_interface script_s; +struct script_interface *script; static inline int GETVALUE(const unsigned char* buf, int i) { return (int)MakeDWord(MakeWord(buf[i], buf[i+1]), MakeWord(buf[i+2], 0)); @@ -18265,22 +18266,22 @@ BUILDIN(getcharip) { } /* check for sd and IP */ - if (!sd || !session[sd->fd]->client_addr) + if (!sd || !sockt->session[sd->fd]->client_addr) { script_pushconststr(st, ""); return true; } /* return the client ip_addr converted for output */ - if (sd && sd->fd && session[sd->fd]) + if (sd && sd->fd && sockt->session[sd->fd]) { /* initiliaze */ const char *ip_addr = NULL; uint32 ip; /* set ip, ip_addr and convert to ip and push str */ - ip = session[sd->fd]->client_addr; - ip_addr = ip2str(ip, NULL); + ip = sockt->session[sd->fd]->client_addr; + ip_addr = sockt->ip2str(ip, NULL); script_pushstrcopy(st, ip_addr); } |