summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/script_commands.txt13
-rw-r--r--src/map/chrif.c9
-rw-r--r--src/map/chrif.h1
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/pc.c8
5 files changed, 15 insertions, 18 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index f5f2d7d9c..9f9dc0049 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -637,8 +637,8 @@ even a value from an another array) to get at an array value:
This will make @arrayofnumbers[100] equal to 10.
-Notice that index numbering always starts with 0. Arrays cannot hold more
-than 128 variables (so the last one can't have a number higher than 127).
+Notice that index numbering always starts with 0. Arrays can hold over
+4 billion variables.
And array indexes probably can't be negative. Nobody tested what happens
when you try to get a negatively numbered variable from an array, but it's
@@ -8508,7 +8508,11 @@ attempts to remove <Item_ID> from the current shop list.
*setcurrency <Val1>{,<Val2>};
-updates the currently attached player shop funds.
+updates the currently attached player shop funds,
+to be used within a "OnCountFunds" event of a NST_CUSTOM trader type.
+
+<Val1> is the value used in the *Cash* Points field
+<Val2> is the value used in the Kafra Points field
---------------------------------------
@@ -8526,7 +8530,8 @@ By default, all npcs staart with tradertype(NST_ZENY);
*purchaseok();
-Signs that the transaction (on a NST_CUSTOM trader) has been successful.
+Signs that the transaction (on a NST_CUSTOM trader) has been successful,
+to be used within a "OnPayFunds" event of a NST_CUSTOM trader.
---------------------------------------
diff --git a/src/map/chrif.c b/src/map/chrif.c
index d66ec1d85..aaef0d6ef 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -126,9 +126,6 @@ bool chrif_auth_delete(int account_id, int char_id, enum sd_state state) {
if ( session[fd] && session[fd]->session_data == node->sd )
session[fd]->session_data = NULL;
- if ( node->char_dat )
- aFree(node->char_dat);
-
if ( node->sd )
aFree(node->sd);
@@ -452,7 +449,7 @@ int chrif_reconnect(DBKey key, DBData *data, va_list ap) {
switch (node->state) {
case ST_LOGIN:
- if ( node->sd && node->char_dat == NULL ) {//Since there is no way to request the char auth, make it fail.
+ if ( node->sd ) {//Since there is no way to request the char auth, make it fail.
pc->authfail(node->sd);
chrif->char_offline(node->sd);
chrif->auth_delete(node->account_id, node->char_id, ST_LOGIN);
@@ -618,7 +615,6 @@ void chrif_authok(int fd) {
sd = node->sd;
if( runflag == MAPSERVER_ST_RUNNING &&
- node->char_dat == NULL &&
node->account_id == account_id &&
node->char_id == char_id &&
node->login_id1 == login_id1 )
@@ -1597,9 +1593,6 @@ void chrif_send_report(char* buf, int len) {
int auth_db_final(DBKey key, DBData *data, va_list ap) {
struct auth_node *node = DB->data2ptr(data);
- if (node->char_dat)
- aFree(node->char_dat);
-
if (node->sd)
aFree(node->sd);
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 24b92908d..1de0901f0 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -32,7 +32,6 @@ struct auth_node {
int login_id1, login_id2, sex, fd;
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
struct map_session_data *sd; //Data from logged on char.
- struct mmo_charstatus *char_dat; //Data from char server.
int64 node_created; //timestamp for node timeouts
enum sd_state state; //To track whether player was login in/out or changing maps.
};
diff --git a/src/map/npc.c b/src/map/npc.c
index 9ed6d2a7e..722e5199c 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2188,7 +2188,7 @@ int npc_unload(struct npc_data* nd, bool single) {
if( single && nd->bl.m != -1 )
map->remove_questinfo(nd->bl.m,nd);
- if( (nd->subtype == SHOP || nd->subtype == CASHSHOP) && nd->src_id == 0) //src check for duplicate shops [Orcao]
+ if( nd->src_id == 0 && ( nd->subtype == SHOP || nd->subtype == CASHSHOP ) ) //src check for duplicate shops [Orcao]
aFree(nd->u.shop.shop_item);
else if( nd->subtype == SCRIPT ) {
struct s_mapiterator* iter;
diff --git a/src/map/pc.c b/src/map/pc.c
index e6ad4e20c..30636f40b 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4343,10 +4343,6 @@ int pc_isUseitem(struct map_session_data *sd,int n)
return 0;
}
- //Dead Branch & Bloody Branch & Porings Box
- if( nameid == ITEMID_BRANCH_OF_DEAD_TREE || nameid == ITEMID_BLOODY_DEAD_BRANCH || nameid == ITEMID_PORING_BOX )
- logs->branch(sd);
-
return 1;
}
@@ -4456,6 +4452,10 @@ int pc_useitem(struct map_session_data *sd,int n) {
}
}
+ //Dead Branch & Bloody Branch & Porings Box
+ if( nameid == ITEMID_BRANCH_OF_DEAD_TREE || nameid == ITEMID_BLOODY_DEAD_BRANCH || nameid == ITEMID_PORING_BOX )
+ logs->branch(sd);
+
sd->itemid = sd->status.inventory[n].nameid;
sd->itemindex = n;
if(sd->catch_target_class != -1) //Abort pet catching.