summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-22 22:56:32 -0300
committershennetsind <ind@henn.et>2014-02-22 22:56:32 -0300
commit6163d9afd1b8536509cb79d123ad6855d89f39e7 (patch)
treef5edb52c3cb20347bb042facc4c5f8ae2d863170 /src/map
parent5421a7e4e6368a5e6e1438043f8e9b9dd5533fc9 (diff)
downloadhercules-6163d9afd1b8536509cb79d123ad6855d89f39e7.tar.gz
hercules-6163d9afd1b8536509cb79d123ad6855d89f39e7.tar.bz2
hercules-6163d9afd1b8536509cb79d123ad6855d89f39e7.tar.xz
hercules-6163d9afd1b8536509cb79d123ad6855d89f39e7.zip
Fixed #send
Was misusing 'fd' instead of 'sd->fd' causing it to have the same effect as @send would (aka it doesn't send to #send's target). found thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index c5460eb47..e7617b2e8 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -210,8 +210,8 @@ ACMD(send)
len=SHRT_MAX-4; // maximum length
off=4;
}
- WFIFOHEAD(fd, len);
- WFIFOW(fd,0)=TOW(type);
+ WFIFOHEAD(sd->fd, len);
+ WFIFOW(sd->fd,0)=TOW(type);
// parse packet contents
SKIP_VALUE(message);
@@ -219,25 +219,25 @@ ACMD(send)
if(ISDIGIT(*message) || *message == '-' || *message == '+')
{// default (byte)
GET_VALUE(message,num);
- WFIFOB(fd,off)=TOB(num);
+ WFIFOB(sd->fd,off)=TOB(num);
++off;
} else if(TOUPPER(*message) == 'B')
{// byte
++message;
GET_VALUE(message,num);
- WFIFOB(fd,off)=TOB(num);
+ WFIFOB(sd->fd,off)=TOB(num);
++off;
} else if(TOUPPER(*message) == 'W')
{// word (2 bytes)
++message;
GET_VALUE(message,num);
- WFIFOW(fd,off)=TOW(num);
+ WFIFOW(sd->fd,off)=TOW(num);
off+=2;
} else if(TOUPPER(*message) == 'L')
{// long word (4 bytes)
++message;
GET_VALUE(message,num);
- WFIFOL(fd,off)=TOL(num);
+ WFIFOL(sd->fd,off)=TOL(num);
off+=4;
} else if(TOUPPER(*message) == 'S')
{// string - escapes are valid
@@ -290,7 +290,7 @@ ACMD(send)
num<<=8;
num+=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10);
}
- WFIFOB(fd,off)=TOB(num);
+ WFIFOB(sd->fd,off)=TOB(num);
++message;
CHECK_EOS(message);
continue;
@@ -319,13 +319,13 @@ ACMD(send)
CHECK_EOS(message);
}
}
- WFIFOB(fd,off)=TOB(num);
+ WFIFOB(sd->fd,off)=TOB(num);
continue;
}
}
} else
num=*message;
- WFIFOB(fd,off)=TOB(num);
+ WFIFOB(sd->fd,off)=TOB(num);
++message;
CHECK_EOS(message);
}//for
@@ -338,7 +338,7 @@ ACMD(send)
// terminate the string
if(off < end)
{// fill the rest with 0's
- memset(WFIFOP(fd,off),0,end-off);
+ memset(WFIFOP(sd->fd,off),0,end-off);
off=end;
}
} else
@@ -350,12 +350,12 @@ ACMD(send)
}
if(packet_db[type].len == -1) {// send dynamic packet
- WFIFOW(fd,2)=TOW(off);
- WFIFOSET(fd,off);
+ WFIFOW(sd->fd,2)=TOW(off);
+ WFIFOSET(sd->fd,off);
} else {// send static packet
if(off < len)
- memset(WFIFOP(fd,off),0,len-off);
- WFIFOSET(fd,len);
+ memset(WFIFOP(sd->fd,off),0,len-off);
+ WFIFOSET(sd->fd,len);
}
} else {
clif->message(fd, msg_txt(259)); // Invalid packet