- Oops, fixed the compilation error.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5331 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
f0725b9248
commit
9ed113263c
@ -9593,6 +9593,7 @@ void clif_parse_DropItem(int fd, struct map_session_data *sd) {
|
|||||||
*------------------------------------------
|
*------------------------------------------
|
||||||
*/
|
*/
|
||||||
void clif_parse_UseItem(int fd, struct map_session_data *sd) {
|
void clif_parse_UseItem(int fd, struct map_session_data *sd) {
|
||||||
|
int n;
|
||||||
RFIFOHEAD(fd);
|
RFIFOHEAD(fd);
|
||||||
|
|
||||||
if (pc_isdead(sd)) {
|
if (pc_isdead(sd)) {
|
||||||
@ -9622,7 +9623,11 @@ void clif_parse_UseItem(int fd, struct map_session_data *sd) {
|
|||||||
|
|
||||||
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
|
//Whether the item is used or not is irrelevant, the char ain't idle. [Skotlex]
|
||||||
sd->idletime = last_tick;
|
sd->idletime = last_tick;
|
||||||
if (!pc_useitem(sd,RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2))
|
n = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
|
||||||
|
|
||||||
|
if(n <0 || n >= MAX_INVENTORY)
|
||||||
|
return 0;
|
||||||
|
if (!pc_useitem(sd,n))
|
||||||
clif_useitemack(sd,n,0,0); //Send an empty ack packet or the client gets stuck.
|
clif_useitemack(sd,n,0,0); //Send an empty ack packet or the client gets stuck.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2814,9 +2814,6 @@ int pc_useitem(struct map_session_data *sd,int n)
|
|||||||
|
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
if(n <0 || n >= MAX_INVENTORY)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if(sd->status.inventory[n].nameid <= 0 ||
|
if(sd->status.inventory[n].nameid <= 0 ||
|
||||||
sd->status.inventory[n].amount <= 0)
|
sd->status.inventory[n].amount <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user