|
@@ -2240,7 +2240,7 @@ static void read_constdb(void)
|
|
continue;
|
|
continue;
|
|
if(line[0]=='/' && line[1]=='/') //ignore commented line
|
|
if(line[0]=='/' && line[1]=='/') //ignore commented line
|
|
continue;
|
|
continue;
|
|
-
|
|
|
|
|
|
+
|
|
type=0;
|
|
type=0;
|
|
if(sscanf(line,"%1023[A-Za-z0-9/_],%1023[A-Za-z0-9/_-],%11d",name,val,&type)>=2 ||
|
|
if(sscanf(line,"%1023[A-Za-z0-9/_],%1023[A-Za-z0-9/_-],%11d",name,val,&type)>=2 ||
|
|
sscanf(line,"%1023[A-Za-z0-9/_] %1023[A-Za-z0-9/_-] %11d",name,val,&type)>=2){
|
|
sscanf(line,"%1023[A-Za-z0-9/_] %1023[A-Za-z0-9/_-] %11d",name,val,&type)>=2){
|
|
@@ -2805,7 +2805,7 @@ unsigned int script_array_highest_key(struct script_state *st, struct map_sessio
|
|
return sa->size ? highest_key + 1 : 0;
|
|
return sa->size ? highest_key + 1 : 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3398,7 +3398,7 @@ struct script_state* script_alloc_state(struct script_code* rootscript, int pos,
|
|
st->oid = oid;
|
|
st->oid = oid;
|
|
st->sleep.timer = INVALID_TIMER;
|
|
st->sleep.timer = INVALID_TIMER;
|
|
st->npc_item_flag = battle_config.item_enabled_npc;
|
|
st->npc_item_flag = battle_config.item_enabled_npc;
|
|
-
|
|
|
|
|
|
+
|
|
if( st->script->instances != USHRT_MAX )
|
|
if( st->script->instances != USHRT_MAX )
|
|
st->script->instances++;
|
|
st->script->instances++;
|
|
else {
|
|
else {
|
|
@@ -6344,14 +6344,14 @@ BUILDIN_FUNC(deletearray)
|
|
list = script_array_cpy_list(sa);
|
|
list = script_array_cpy_list(sa);
|
|
size = sa->size;
|
|
size = sa->size;
|
|
qsort(list, size, sizeof(unsigned int), script_array_index_cmp);
|
|
qsort(list, size, sizeof(unsigned int), script_array_index_cmp);
|
|
-
|
|
|
|
|
|
+
|
|
ARR_FIND(0, size, i, list[i] >= start);
|
|
ARR_FIND(0, size, i, list[i] >= start);
|
|
-
|
|
|
|
|
|
+
|
|
for( ; i < size && list[i] < start + count; i++ ) {
|
|
for( ; i < size && list[i] < start + count; i++ ) {
|
|
// Clear any entries between start and start+count, if they exist
|
|
// Clear any entries between start and start+count, if they exist
|
|
set_reg(st, sd, reference_uid(id, list[i]), name, value, reference_getref(data));
|
|
set_reg(st, sd, reference_uid(id, list[i]), name, value, reference_getref(data));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
for( ; i < size && list[i] < end; i++ ) {
|
|
for( ; i < size && list[i] < end; i++ ) {
|
|
// Move back count positions any entries between start+count to fill the gaps
|
|
// Move back count positions any entries between start+count to fill the gaps
|
|
void* v = get_val2(st, reference_uid(id, list[i]), reference_getref(data));
|
|
void* v = get_val2(st, reference_uid(id, list[i]), reference_getref(data));
|
|
@@ -6365,7 +6365,7 @@ BUILDIN_FUNC(deletearray)
|
|
unsigned int *list = NULL, size = 0;
|
|
unsigned int *list = NULL, size = 0;
|
|
list = script_array_cpy_list(sa);
|
|
list = script_array_cpy_list(sa);
|
|
size = sa->size;
|
|
size = sa->size;
|
|
-
|
|
|
|
|
|
+
|
|
for(i = 0; i < size; i++) {
|
|
for(i = 0; i < size; i++) {
|
|
if( list[i] >= start ) // Less expensive than sorting it, most likely
|
|
if( list[i] >= start ) // Less expensive than sorting it, most likely
|
|
set_reg(st, sd, reference_uid(id, list[i]), name, value, reference_getref(data));
|
|
set_reg(st, sd, reference_uid(id, list[i]), name, value, reference_getref(data));
|
|
@@ -6509,7 +6509,7 @@ BUILDIN_FUNC(countitem)
|
|
i = 1;
|
|
i = 1;
|
|
aid = 10;
|
|
aid = 10;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if( script_hasdata(st,aid) ) {
|
|
if( script_hasdata(st,aid) ) {
|
|
if( !(sd = map_id2sd( (aid = script_getnum(st, aid)) )) ) {
|
|
if( !(sd = map_id2sd( (aid = script_getnum(st, aid)) )) ) {
|
|
ShowError("buildin_%s: player not found (AID=%d).\n", command, aid);
|
|
ShowError("buildin_%s: player not found (AID=%d).\n", command, aid);
|
|
@@ -6521,7 +6521,7 @@ BUILDIN_FUNC(countitem)
|
|
if( !(sd = script_rid2sd(st)) )
|
|
if( !(sd = script_rid2sd(st)) )
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if( !strncmp(command, "cart", 4) ) {
|
|
if( !strncmp(command, "cart", 4) ) {
|
|
loc = 1;
|
|
loc = 1;
|
|
size = MAX_CART;
|
|
size = MAX_CART;
|
|
@@ -6543,7 +6543,7 @@ BUILDIN_FUNC(countitem)
|
|
script_pushint(st,-1);
|
|
script_pushint(st,-1);
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
data = script_getdata(st, 2);
|
|
data = script_getdata(st, 2);
|
|
get_val(st, data); // Convert into value in case of a variable
|
|
get_val(st, data); // Convert into value in case of a variable
|
|
|
|
|
|
@@ -7090,7 +7090,7 @@ BUILDIN_FUNC(rentitem2) {
|
|
ShowError("buildin_rentitem2: invalid data type for argument #1 (%d).\n", data->type);
|
|
ShowError("buildin_rentitem2: invalid data type for argument #1 (%d).\n", data->type);
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
seconds = script_getnum(st,3);
|
|
seconds = script_getnum(st,3);
|
|
iden = script_getnum(st,4);
|
|
iden = script_getnum(st,4);
|
|
ref = script_getnum(st,5);
|
|
ref = script_getnum(st,5);
|
|
@@ -7287,7 +7287,7 @@ BUILDIN_FUNC(makeitem2) {
|
|
struct item item_tmp;
|
|
struct item item_tmp;
|
|
struct script_data *data;
|
|
struct script_data *data;
|
|
struct item_data *id;
|
|
struct item_data *id;
|
|
-
|
|
|
|
|
|
+
|
|
data = script_getdata(st,2);
|
|
data = script_getdata(st,2);
|
|
get_val(st,data);
|
|
get_val(st,data);
|
|
if( data_isstring(data) ){
|
|
if( data_isstring(data) ){
|
|
@@ -7315,7 +7315,7 @@ BUILDIN_FUNC(makeitem2) {
|
|
}
|
|
}
|
|
else
|
|
else
|
|
m = map_mapname2mapid(mapname);
|
|
m = map_mapname2mapid(mapname);
|
|
-
|
|
|
|
|
|
+
|
|
if ((id = itemdb_search(nameid))) {
|
|
if ((id = itemdb_search(nameid))) {
|
|
char iden, ref, attr;
|
|
char iden, ref, attr;
|
|
memset(&item_tmp,0,sizeof(item_tmp));
|
|
memset(&item_tmp,0,sizeof(item_tmp));
|
|
@@ -7323,7 +7323,7 @@ BUILDIN_FUNC(makeitem2) {
|
|
|
|
|
|
iden = (char)script_getnum(st,7);
|
|
iden = (char)script_getnum(st,7);
|
|
ref = (char)script_getnum(st,8);
|
|
ref = (char)script_getnum(st,8);
|
|
- attr = (char)script_getnum(st,9);
|
|
|
|
|
|
+ attr = (char)script_getnum(st,9);
|
|
|
|
|
|
if (id->type==IT_WEAPON || id->type==IT_ARMOR || id->type==IT_SHADOWGEAR) {
|
|
if (id->type==IT_WEAPON || id->type==IT_ARMOR || id->type==IT_SHADOWGEAR) {
|
|
if(ref > MAX_REFINE) ref = MAX_REFINE;
|
|
if(ref > MAX_REFINE) ref = MAX_REFINE;
|
|
@@ -7336,7 +7336,7 @@ BUILDIN_FUNC(makeitem2) {
|
|
iden = 1;
|
|
iden = 1;
|
|
ref = attr = 0;
|
|
ref = attr = 0;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
item_tmp.identify = iden;
|
|
item_tmp.identify = iden;
|
|
item_tmp.refine = ref;
|
|
item_tmp.refine = ref;
|
|
item_tmp.attribute = attr;
|
|
item_tmp.attribute = attr;
|
|
@@ -7972,7 +7972,7 @@ BUILDIN_FUNC(getguildname)
|
|
guild_id = script_getnum(st,2);
|
|
guild_id = script_getnum(st,2);
|
|
if( ( g = guild_search(guild_id) ) != NULL )
|
|
if( ( g = guild_search(guild_id) ) != NULL )
|
|
script_pushstrcopy(st,g->name);
|
|
script_pushstrcopy(st,g->name);
|
|
- else
|
|
|
|
|
|
+ else
|
|
script_pushconststr(st,"null");
|
|
script_pushconststr(st,"null");
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
@@ -7989,7 +7989,7 @@ BUILDIN_FUNC(getguildmaster)
|
|
guild_id = script_getnum(st,2);
|
|
guild_id = script_getnum(st,2);
|
|
if( ( g = guild_search(guild_id) ) != NULL )
|
|
if( ( g = guild_search(guild_id) ) != NULL )
|
|
script_pushstrcopy(st,g->member[0].name);
|
|
script_pushstrcopy(st,g->member[0].name);
|
|
- else
|
|
|
|
|
|
+ else
|
|
script_pushconststr(st,"null");
|
|
script_pushconststr(st,"null");
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
@@ -9115,7 +9115,7 @@ BUILDIN_FUNC(end)
|
|
if (sd){
|
|
if (sd){
|
|
if (sd->state.callshop == 0)
|
|
if (sd->state.callshop == 0)
|
|
clif_scriptclose(sd, st->oid); // If a menu/select/prompt is active, close it.
|
|
clif_scriptclose(sd, st->oid); // If a menu/select/prompt is active, close it.
|
|
- else
|
|
|
|
|
|
+ else
|
|
sd->state.callshop = 0;
|
|
sd->state.callshop = 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -11375,7 +11375,7 @@ BUILDIN_FUNC(waitingroomkick)
|
|
struct npc_data* nd;
|
|
struct npc_data* nd;
|
|
struct chat_data* cd;
|
|
struct chat_data* cd;
|
|
const char* kickusername;
|
|
const char* kickusername;
|
|
-
|
|
|
|
|
|
+
|
|
nd = npc_name2id(script_getstr(st,2));
|
|
nd = npc_name2id(script_getstr(st,2));
|
|
kickusername = script_getstr(st,3);
|
|
kickusername = script_getstr(st,3);
|
|
|
|
|
|
@@ -11399,7 +11399,7 @@ BUILDIN_FUNC(getwaitingroomusers)
|
|
nd = npc_name2id(script_getstr(st, 2));
|
|
nd = npc_name2id(script_getstr(st, 2));
|
|
else
|
|
else
|
|
nd = (struct npc_data *)map_id2bl(st->oid);
|
|
nd = (struct npc_data *)map_id2bl(st->oid);
|
|
-
|
|
|
|
|
|
+
|
|
if( nd != NULL && (cd=(struct chat_data *)map_id2bl(nd->chat_id)) != NULL ) {
|
|
if( nd != NULL && (cd=(struct chat_data *)map_id2bl(nd->chat_id)) != NULL ) {
|
|
for(i = 0; i < cd->users; ++i) {
|
|
for(i = 0; i < cd->users; ++i) {
|
|
setd_sub(st, NULL, ".@waitingroom_users", j, (void *)__64BPRTSIZE(cd->usersd[i]->status.account_id), NULL);
|
|
setd_sub(st, NULL, ".@waitingroom_users", j, (void *)__64BPRTSIZE(cd->usersd[i]->status.account_id), NULL);
|
|
@@ -13909,7 +13909,7 @@ BUILDIN_FUNC(atcommand) {
|
|
|
|
|
|
/** Displays a message for the player only (like system messages like "you got an apple" )
|
|
/** Displays a message for the player only (like system messages like "you got an apple" )
|
|
* dispbottom("<message>"{,<color>{,<char_id>}})
|
|
* dispbottom("<message>"{,<color>{,<char_id>}})
|
|
-* @param message
|
|
|
|
|
|
+* @param message
|
|
* @param color Hex color default (Green)
|
|
* @param color Hex color default (Green)
|
|
*/
|
|
*/
|
|
BUILDIN_FUNC(dispbottom)
|
|
BUILDIN_FUNC(dispbottom)
|
|
@@ -18497,7 +18497,7 @@ BUILDIN_FUNC(setquest)
|
|
}
|
|
}
|
|
|
|
|
|
//20120410 or 20090218 ? no reason that shouldn't work for 2009
|
|
//20120410 or 20090218 ? no reason that shouldn't work for 2009
|
|
- pc_show_questinfo(sd);
|
|
|
|
|
|
+ pc_show_questinfo(sd);
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -18541,7 +18541,7 @@ BUILDIN_FUNC(completequest)
|
|
BUILDIN_FUNC(changequest)
|
|
BUILDIN_FUNC(changequest)
|
|
{
|
|
{
|
|
struct map_session_data *sd;
|
|
struct map_session_data *sd;
|
|
-
|
|
|
|
|
|
+
|
|
if (!script_charid2sd(4,sd))
|
|
if (!script_charid2sd(4,sd))
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
@@ -18674,7 +18674,7 @@ BUILDIN_FUNC(waitingroom2bg)
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
for (i = 0; i < cd->users; i++) { // Only add those who are in the chat room
|
|
for (i = 0; i < cd->users; i++) { // Only add those who are in the chat room
|
|
struct map_session_data *sd;
|
|
struct map_session_data *sd;
|
|
if( (sd = cd->usersd[i]) != NULL && bg_team_join(bg_id, sd) ){
|
|
if( (sd = cd->usersd[i]) != NULL && bg_team_join(bg_id, sd) ){
|
|
@@ -19541,7 +19541,7 @@ BUILDIN_FUNC(showdigit)
|
|
**/
|
|
**/
|
|
BUILDIN_FUNC(makerune) {
|
|
BUILDIN_FUNC(makerune) {
|
|
TBL_PC* sd;
|
|
TBL_PC* sd;
|
|
-
|
|
|
|
|
|
+
|
|
if (!script_charid2sd(3,sd))
|
|
if (!script_charid2sd(3,sd))
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
clif_skill_produce_mix_list(sd,RK_RUNEMASTERY,24);
|
|
clif_skill_produce_mix_list(sd,RK_RUNEMASTERY,24);
|
|
@@ -19553,7 +19553,7 @@ BUILDIN_FUNC(makerune) {
|
|
**/
|
|
**/
|
|
BUILDIN_FUNC(checkdragon) {
|
|
BUILDIN_FUNC(checkdragon) {
|
|
TBL_PC* sd;
|
|
TBL_PC* sd;
|
|
-
|
|
|
|
|
|
+
|
|
if (!script_charid2sd(2,sd))
|
|
if (!script_charid2sd(2,sd))
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
if( pc_isridingdragon(sd) )
|
|
if( pc_isridingdragon(sd) )
|
|
@@ -19607,7 +19607,7 @@ BUILDIN_FUNC(setdragon) {
|
|
**/
|
|
**/
|
|
BUILDIN_FUNC(ismounting) {
|
|
BUILDIN_FUNC(ismounting) {
|
|
TBL_PC* sd;
|
|
TBL_PC* sd;
|
|
-
|
|
|
|
|
|
+
|
|
if (!script_charid2sd(2,sd))
|
|
if (!script_charid2sd(2,sd))
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
if( &sd->sc && sd->sc.data[SC_ALL_RIDING] )
|
|
if( &sd->sc && sd->sc.data[SC_ALL_RIDING] )
|
|
@@ -19625,7 +19625,7 @@ BUILDIN_FUNC(ismounting) {
|
|
**/
|
|
**/
|
|
BUILDIN_FUNC(setmounting) {
|
|
BUILDIN_FUNC(setmounting) {
|
|
TBL_PC* sd;
|
|
TBL_PC* sd;
|
|
-
|
|
|
|
|
|
+
|
|
if (!script_charid2sd(2,sd))
|
|
if (!script_charid2sd(2,sd))
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
if( &sd->sc && sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR) ) {
|
|
if( &sd->sc && sd->sc.option&(OPTION_WUGRIDER|OPTION_RIDING|OPTION_DRAGON|OPTION_MADOGEAR) ) {
|
|
@@ -19966,10 +19966,10 @@ BUILDIN_FUNC(getrandgroupitem) {
|
|
BUILDIN_FUNC(getgroupitem) {
|
|
BUILDIN_FUNC(getgroupitem) {
|
|
TBL_PC *sd;
|
|
TBL_PC *sd;
|
|
int group_id = script_getnum(st,2);
|
|
int group_id = script_getnum(st,2);
|
|
-
|
|
|
|
|
|
+
|
|
if (!script_charid2sd(3,sd))
|
|
if (!script_charid2sd(3,sd))
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
-
|
|
|
|
|
|
+
|
|
if (itemdb_pc_get_itemgroup(group_id,sd)) {
|
|
if (itemdb_pc_get_itemgroup(group_id,sd)) {
|
|
ShowError("buildin_getgroupitem: Invalid group id '%d' specified.\n",group_id);
|
|
ShowError("buildin_getgroupitem: Invalid group id '%d' specified.\n",group_id);
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
@@ -20027,7 +20027,7 @@ BUILDIN_FUNC(npcskill)
|
|
struct npc_data *nd;
|
|
struct npc_data *nd;
|
|
struct map_session_data *sd;
|
|
struct map_session_data *sd;
|
|
struct script_data *data;
|
|
struct script_data *data;
|
|
-
|
|
|
|
|
|
+
|
|
data = script_getdata(st, 2);
|
|
data = script_getdata(st, 2);
|
|
get_val(st, data); // Convert into value in case of a variable
|
|
get_val(st, data); // Convert into value in case of a variable
|
|
skill_id = data_isstring(data) ? skill_name2id(script_getstr(st, 2)) : script_getnum(st, 2);
|
|
skill_id = data_isstring(data) ? skill_name2id(script_getstr(st, 2)) : script_getnum(st, 2);
|
|
@@ -20504,7 +20504,7 @@ BUILDIN_FUNC(vip_time) {
|
|
if (sd == NULL)
|
|
if (sd == NULL)
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
- chrif_req_login_operation(sd->status.account_id, sd->status.name, CHRIF_OP_LOGIN_VIP, viptime, 7, 0);
|
|
|
|
|
|
+ chrif_req_login_operation(sd->status.account_id, sd->status.name, CHRIF_OP_LOGIN_VIP, viptime, 7, 0);
|
|
#endif
|
|
#endif
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
@@ -20632,7 +20632,7 @@ BUILDIN_FUNC(bonus_script) {
|
|
|
|
|
|
if (sd == NULL)
|
|
if (sd == NULL)
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
-
|
|
|
|
|
|
+
|
|
script_str = script_getstr(st,2);
|
|
script_str = script_getstr(st,2);
|
|
dur = 1000 * abs(script_getnum(st,3));
|
|
dur = 1000 * abs(script_getnum(st,3));
|
|
FETCH(4, flag);
|
|
FETCH(4, flag);
|
|
@@ -20787,7 +20787,7 @@ BUILDIN_FUNC(addspiritball) {
|
|
uint8 i, count = script_getnum(st,2);
|
|
uint8 i, count = script_getnum(st,2);
|
|
uint16 duration = script_getnum(st,3);
|
|
uint16 duration = script_getnum(st,3);
|
|
struct map_session_data *sd = NULL;
|
|
struct map_session_data *sd = NULL;
|
|
-
|
|
|
|
|
|
+
|
|
if (count == 0)
|
|
if (count == 0)
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
|
|
|
@@ -20816,10 +20816,10 @@ BUILDIN_FUNC(addspiritball) {
|
|
BUILDIN_FUNC(delspiritball) {
|
|
BUILDIN_FUNC(delspiritball) {
|
|
uint8 count = script_getnum(st,2);
|
|
uint8 count = script_getnum(st,2);
|
|
struct map_session_data *sd = NULL;
|
|
struct map_session_data *sd = NULL;
|
|
-
|
|
|
|
|
|
+
|
|
if (count == 0)
|
|
if (count == 0)
|
|
count = 1;
|
|
count = 1;
|
|
-
|
|
|
|
|
|
+
|
|
if (script_hasdata(st,3)) {
|
|
if (script_hasdata(st,3)) {
|
|
if (!script_isstring(st,3))
|
|
if (!script_isstring(st,3))
|
|
sd = map_charid2sd(script_getnum(st,3));
|
|
sd = map_charid2sd(script_getnum(st,3));
|
|
@@ -20975,7 +20975,7 @@ BUILDIN_FUNC(npcshopupdate) {
|
|
script_pushint(st,0);
|
|
script_pushint(st,0);
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (!nd->u.shop.count) {
|
|
if (!nd->u.shop.count) {
|
|
ShowError("buildin_npcshopupdate: Attempt to update empty shop from '%s'.\n", nd->exname);
|
|
ShowError("buildin_npcshopupdate: Attempt to update empty shop from '%s'.\n", nd->exname);
|
|
script_pushint(st,0);
|
|
script_pushint(st,0);
|
|
@@ -21374,10 +21374,10 @@ BUILDIN_FUNC(minmax){
|
|
int value;
|
|
int value;
|
|
// Function pointer for our comparison function (either min or max at the moment)
|
|
// Function pointer for our comparison function (either min or max at the moment)
|
|
int32 (*func)(int32, int32);
|
|
int32 (*func)(int32, int32);
|
|
-
|
|
|
|
|
|
+
|
|
// Get the real function name
|
|
// Get the real function name
|
|
functionname = script_getfuncname(st);
|
|
functionname = script_getfuncname(st);
|
|
-
|
|
|
|
|
|
+
|
|
// Our data should start at offset 2
|
|
// Our data should start at offset 2
|
|
i = 2;
|
|
i = 2;
|
|
|
|
|
|
@@ -21402,7 +21402,7 @@ BUILDIN_FUNC(minmax){
|
|
// As long as we have data on our script stack
|
|
// As long as we have data on our script stack
|
|
while( script_hasdata(st,i) ){
|
|
while( script_hasdata(st,i) ){
|
|
struct script_data *data;
|
|
struct script_data *data;
|
|
-
|
|
|
|
|
|
+
|
|
// Get the next piece of data from the script stack
|
|
// Get the next piece of data from the script stack
|
|
data = script_getdata( st, i );
|
|
data = script_getdata( st, i );
|
|
|
|
|
|
@@ -21444,7 +21444,7 @@ BUILDIN_FUNC(minmax){
|
|
// Skip empty arrays
|
|
// Skip empty arrays
|
|
if( start < end ){
|
|
if( start < end ){
|
|
int id;
|
|
int id;
|
|
-
|
|
|
|
|
|
+
|
|
// For getting the values we need the id of the array
|
|
// For getting the values we need the id of the array
|
|
id = reference_getid( data );
|
|
id = reference_getid( data );
|
|
|
|
|