summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c94
-rw-r--r--src/map/atcommand.h2
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/charcommand.c4
-rw-r--r--src/map/chrif.c1
-rw-r--r--src/map/chrif.h2
-rw-r--r--src/map/guild.c30
-rw-r--r--src/map/intif.c32
-rw-r--r--src/map/mail.c2
-rw-r--r--src/map/party.c10
-rw-r--r--src/map/pet.c2
-rw-r--r--src/map/script.c94
-rw-r--r--src/map/skill.c8
-rw-r--r--src/map/storage.c30
14 files changed, 158 insertions, 157 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 55a08873c..b236b211c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -552,8 +552,8 @@ static AtCommandInfo atcommand_info[] = {
* Generic variables
*-----------------------------------------
*/
-unsigned char atcmd_output[200];
-unsigned char atcmd_player_name[100];
+char atcmd_output[200];
+char atcmd_player_name[100];
/*====================================================
* This function return the name of the job (by [Yor])
@@ -674,9 +674,9 @@ char * msg_txt(int msg_number) {
//------------------------------------------------------------
// E-mail check: return 0 (not correct) or 1 (valid). by [Yor]
//------------------------------------------------------------
-int e_mail_check(unsigned char *email) {
+int e_mail_check(char *email) {
char ch;
- unsigned char* last_arobas;
+ char* last_arobas;
// athena limits
if (strlen(email) < 3 || strlen(email) > 39)
@@ -1241,7 +1241,7 @@ int atcommand_who(
count = 0;
GM_level = pc_isGM(sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_GM_level = pc_isGM(pl_sd);
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
memcpy(player_name, pl_sd->status.name, 24);
@@ -1299,7 +1299,7 @@ int atcommand_who2(
count = 0;
GM_level = pc_isGM(sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_GM_level = pc_isGM(pl_sd);
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
memcpy(player_name, pl_sd->status.name, 24);
@@ -1363,7 +1363,7 @@ int atcommand_who3(
count = 0;
GM_level = pc_isGM(sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_GM_level = pc_isGM(pl_sd);
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
memcpy(player_name, pl_sd->status.name, 24);
@@ -1433,7 +1433,7 @@ int atcommand_whomap(
count = 0;
GM_level = pc_isGM(sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_GM_level = pc_isGM(pl_sd);
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
if (pl_sd->bl.m == map_id) {
@@ -1492,7 +1492,7 @@ int atcommand_whomap2(
count = 0;
GM_level = pc_isGM(sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_GM_level = pc_isGM(pl_sd);
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
if (pl_sd->bl.m == map_id) {
@@ -1557,7 +1557,7 @@ int atcommand_whomap3(
count = 0;
GM_level = pc_isGM(sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_GM_level = pc_isGM(pl_sd);
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
if (pl_sd->bl.m == map_id) {
@@ -1628,7 +1628,7 @@ int atcommand_whogm(
count = 0;
GM_level = pc_isGM(sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_GM_level = pc_isGM(pl_sd);
if (pl_GM_level > 0) {
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
@@ -1697,7 +1697,7 @@ int atcommand_whozeny(
count = 0;
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
memcpy(player_name, pl_sd->status.name, 24);
for (j = 0; player_name[j]; j++)
player_name[j] = tolower(player_name[j]);
@@ -1716,7 +1716,7 @@ int atcommand_whozeny(
for (i = 0; i < fd_max; i++) {
if(!zeny[c])
continue;
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && zeny[c] && counted[i]==0) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && zeny[c] && counted[i]==0) {
if(pl_sd->status.zeny==zeny[c]) {
sprintf(atcmd_output, "Name: %s | Zeny: %d", pl_sd->status.name, pl_sd->status.zeny);
clif_displaymessage(fd, atcmd_output);
@@ -1754,7 +1754,7 @@ int atcommand_happyhappyjoyjoy(
nullpo_retr(-1, sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
e=rand()%40;
if(e==34)
e = 0;
@@ -2668,7 +2668,7 @@ int atcommand_pvpoff(
map[sd->bl.m].flag.pvp = 0;
clif_send0199(sd->bl.m, 0);
for (i = 0; i < fd_max; i++) { //人数分ループ
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
if (sd->bl.m == pl_sd->bl.m) {
clif_pvpset(pl_sd, 0, 0, 2);
if (pl_sd->pvp_timer != -1) {
@@ -2708,7 +2708,7 @@ int atcommand_pvpon(
map[sd->bl.m].flag.pvp = 1;
clif_send0199(sd->bl.m, 1);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
if (sd->bl.m == pl_sd->bl.m && pl_sd->pvp_timer == -1) {
pl_sd->pvp_timer = add_timer(gettick() + 200,
pc_calc_pvprank_timer, pl_sd->bl.id, 0);
@@ -4480,7 +4480,7 @@ int atcommand_night(
if (night_flag != 1) {
night_flag = 1; // 0=day, 1=night [Yor]
for(i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && !map[sd->bl.m].flag.indoors) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && !map[sd->bl.m].flag.indoors) {
//pl_sd->opt2 |= STATE_BLIND;
//clif_changeoption(&pl_sd->bl);
if (battle_config.night_darkness_level > 0)
@@ -4516,7 +4516,7 @@ int atcommand_day(
if (night_flag != 0) {
night_flag = 0; // 0=day, 1=night [Yor]
for(i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
if (battle_config.night_darkness_level > 0)
clif_refresh (pl_sd);
else {
@@ -4547,7 +4547,7 @@ int atcommand_doom(
nullpo_retr(-1, sd);
clif_specialeffect(&sd->bl,450,2);
for(i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && i != fd &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && i != fd &&
pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
pc_damage(NULL, pl_sd, pl_sd->status.hp + 1);
clif_displaymessage(pl_sd->fd, msg_table[61]); // The holy messenger has given judgement.
@@ -4571,7 +4571,7 @@ int atcommand_doommap(
nullpo_retr(-1, sd);
clif_specialeffect(&sd->bl,450,3);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && i != fd && sd->bl.m == pl_sd->bl.m &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && i != fd && sd->bl.m == pl_sd->bl.m &&
pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
pc_damage(NULL, pl_sd, pl_sd->status.hp + 1);
// clif_specialeffect(&pl_sd->bl,450,1);
@@ -4616,7 +4616,7 @@ int atcommand_raise(
for (i = 0; i < fd_max; i++) {
if (session[i])
- atcommand_raise_sub(session[i]->session_data);
+ atcommand_raise_sub((struct map_session_data *) session[i]->session_data);
}
clif_displaymessage(fd, msg_table[64]); // Mercy has been granted.
@@ -4637,7 +4637,7 @@ int atcommand_raisemap(
nullpo_retr(-1, sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && sd->bl.m == pl_sd->bl.m)
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && sd->bl.m == pl_sd->bl.m)
atcommand_raise_sub(pl_sd);
}
clif_displaymessage(fd, msg_table[64]); // Mercy has been granted.
@@ -4841,7 +4841,7 @@ int atcommand_kickall(
nullpo_retr(-1, sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth &&
pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can kick only lower or same gm level
if (sd->status.account_id != pl_sd->status.account_id)
clif_GM_kick(sd, pl_sd, 0);
@@ -5184,7 +5184,7 @@ int atcommand_mapexit(
nullpo_retr(-1, sd);
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
if (sd->status.account_id != pl_sd->status.account_id)
clif_GM_kick(sd, pl_sd, 0);
}
@@ -5469,7 +5469,7 @@ int atcommand_recallall(
count = 0;
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && sd->status.account_id != pl_sd->status.account_id &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && sd->status.account_id != pl_sd->status.account_id &&
pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can recall only lower or same level
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd))
count++;
@@ -5519,7 +5519,7 @@ int atcommand_guildrecall(
(g = guild_search(atoi(message))) != NULL) {
count = 0;
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth &&
sd->status.account_id != pl_sd->status.account_id &&
pl_sd->status.guild_id == g->guild_id) {
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd))
@@ -5574,7 +5574,7 @@ int atcommand_partyrecall(
(p = party_search(atoi(message))) != NULL) {
count = 0;
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth &&
sd->status.account_id != pl_sd->status.account_id &&
pl_sd->status.party_id == p->party_id) {
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && battle_config.any_warp_GM_min_level > pc_isGM(sd))
@@ -5742,7 +5742,7 @@ int atcommand_mapinfo(
clif_displaymessage(fd, atcmd_output);
chat_num = 0;
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth &&
(cd = (struct chat_data*)map_id2bl(pl_sd->chatID))) {
chat_num++;
}
@@ -5781,7 +5781,7 @@ int atcommand_mapinfo(
case 1:
clif_displaymessage(fd, "----- Players in Map -----");
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && strcmp(pl_sd->mapname, atcmd_player_name) == 0) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && strcmp(pl_sd->mapname, atcmd_player_name) == 0) {
sprintf(atcmd_output, "Player '%s' (session #%d) | Location: %d,%d",
pl_sd->status.name, i, pl_sd->bl.x, pl_sd->bl.y);
clif_displaymessage(fd, atcmd_output);
@@ -5812,7 +5812,7 @@ int atcommand_mapinfo(
case 3:
clif_displaymessage(fd, "----- Chats in Map -----");
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth &&
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth &&
(cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) &&
strcmp(pl_sd->mapname, atcmd_player_name) == 0 &&
cd->usersd[0] == pl_sd) {
@@ -6483,7 +6483,7 @@ int atcommand_disguiseall(
(mob_id >= 813 && mob_id <= 834) || // NPC
(mob_id > 1000 && mob_id < 1582)) { // monsters
for(i=0; i < fd_max; i++) {
- if(session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if(session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
if(pc_isriding(pl_sd)) { // temporary prevention of crash caused by peco + disguise, will look into a better solution [Valaris]
clif_displaymessage(fd, msg_table[227]); // Cannot wear disguise while riding a Peco.
} else {
@@ -6536,7 +6536,7 @@ int atcommand_undisguiseall(
nullpo_retr(-1, sd);
for(i=0; i < fd_max; i++) {
- if(session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && pl_sd->disguise) {
+ if(session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && pl_sd->disguise) {
clif_clearchar(&pl_sd->bl, 9);
pl_sd->disguise = 0;
pc_setpos(pl_sd, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y, 3);
@@ -6751,7 +6751,7 @@ int atcommand_effect(
}
else{
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
clif_specialeffect(&pl_sd->bl, type, flag);
clif_displaymessage(pl_sd->fd, msg_table[229]); // Your effect has changed.
}
@@ -8259,7 +8259,7 @@ int charid2sessionid(int charid)
struct map_session_data *pl_sd = NULL;
for(i=0;i<fd_max;i++){
- if(session[i] && (pl_sd=session[i]->session_data) && pl_sd->state.auth){
+ if(session[i] && (pl_sd= (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth){
if (pl_sd->status.char_id==charid) { session_id = i; break; }
}
}
@@ -8274,7 +8274,7 @@ int accountid2sessionid(int accountid)
struct map_session_data *pl_sd = NULL;
for(i=0;i<fd_max;i++){
- if(session[i] && (pl_sd=session[i]->session_data) && pl_sd->state.auth){
+ if(session[i] && (pl_sd= (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth){
if (pl_sd->status.account_id==accountid) { session_id = i; break; }
}
}
@@ -8310,7 +8310,7 @@ int atcommand_jumptoid(
if ((session_id=charid2sessionid(cid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, msg_table[247]);
return -1;
@@ -8363,7 +8363,7 @@ int atcommand_jumptoid2(
if ((session_id=accountid2sessionid(aid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, msg_table[247]);
return -1;
@@ -8415,7 +8415,7 @@ int atcommand_recallid(
if ((session_id=charid2sessionid(cid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can recall only lower or same level
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, msg_table[247]);
@@ -8472,7 +8472,7 @@ int atcommand_recallid2(
if ((session_id=accountid2sessionid(aid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can recall only lower or same level
if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && battle_config.any_warp_GM_min_level > pc_isGM(sd)) {
clif_displaymessage(fd, msg_table[247]);
@@ -8528,7 +8528,7 @@ int atcommand_kickid(
if ((session_id=charid2sessionid(cid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) // you can kick only lower or same gm level
clif_GM_kick(sd, pl_sd, 1);
else {
@@ -8575,7 +8575,7 @@ int atcommand_kickid2(
if ((session_id=accountid2sessionid(aid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) // you can kick only lower or same gm level
clif_GM_kick(sd, pl_sd, 1);
else {
@@ -8622,7 +8622,7 @@ int atcommand_reviveid(
if ((session_id=charid2sessionid(cid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
pl_sd->status.hp = pl_sd->status.max_hp;
pc_setstand(pl_sd);
if (battle_config.pc_invincible_time > 0)
@@ -8672,7 +8672,7 @@ int atcommand_reviveid2(
if ((session_id=accountid2sessionid(aid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
pl_sd->status.hp = pl_sd->status.max_hp;
pc_setstand(pl_sd);
if (battle_config.pc_invincible_time > 0)
@@ -8722,7 +8722,7 @@ int atcommand_killid(
if ((session_id=charid2sessionid(cid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can kill only lower or same level
pc_damage(NULL, pl_sd, pl_sd->status.hp + 1);
clif_displaymessage(fd, msg_table[14]); // Character killed.
@@ -8770,7 +8770,7 @@ int atcommand_killid2(
if ((session_id=accountid2sessionid(aid))!=0)
{
- if ((pl_sd = session[session_id]->session_data) != NULL) {
+ if ((pl_sd = (struct map_session_data *) session[session_id]->session_data) != NULL) {
if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can kill only lower or same level
pc_damage(NULL, pl_sd, pl_sd->status.hp + 1);
clif_displaymessage(fd, msg_table[14]); // Character killed.
@@ -8815,7 +8815,7 @@ atcommand_charkillableid(
if ((session_id=charid2sessionid(cid))!=0)
{
- if((pl_sd=session[session_id]->session_data) == NULL)
+ if((pl_sd= (struct map_session_data *) session[session_id]->session_data) == NULL)
return -1;
pl_sd->special_state.killable = !pl_sd->special_state.killable;
@@ -8856,7 +8856,7 @@ atcommand_charkillableid2(
if ((session_id=accountid2sessionid(aid))!=0)
{
- if((pl_sd=session[session_id]->session_data) == NULL)
+ if((pl_sd= (struct map_session_data *) session[session_id]->session_data) == NULL)
return -1;
pl_sd->special_state.killable = !pl_sd->special_state.killable;
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index f74ebeef3..6dcd6cc59 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -281,7 +281,7 @@ void do_final_msg();
char *estr_lower(char *str);
char * job_name(int class_);
-int e_mail_check(unsigned char *email);
+int e_mail_check(char *email);
#endif
diff --git a/src/map/battle.c b/src/map/battle.c
index 46d84705c..78d8215ab 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3966,7 +3966,7 @@ int battle_config_switch(const char *str) {
static const struct {
char str[128];
- int *val;
+ void *val;
} battle_data[] = {
{ "warp_point_debug", &battle_config.warp_point_debug },
{ "enemy_critical", &battle_config.enemy_critical },
@@ -4210,7 +4210,7 @@ int battle_set_value(char *w1, char *w2) {
int i;
for(i = 0; i < sizeof(battle_data) / (sizeof(battle_data[0])); i++)
if (strcmpi(w1, battle_data[i].str) == 0) {
- *battle_data[i].val = battle_config_switch(w2);
+ *((unsigned int *) battle_data[i].val) = battle_config_switch(w2);
return 1;
}
return 0;
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index ed18f27a4..9b700dc47 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -700,7 +700,7 @@ int charcommand_stats_all(const int fd, struct map_session_data* sd, const char*
count = 0;
for(i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
if (pc_isGM(pl_sd) > 0)
sprintf(gmlevel, "| GM Lvl: %d", pc_isGM(pl_sd));
@@ -1088,7 +1088,7 @@ int charcommand_item(
}
} else if(/* from jA's @giveitem */strcmpi(character,"all")==0 || strcmpi(character,"everyone")==0){
for (i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data)){
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data)){
charcommand_giveitem_sub(pl_sd,item_data,number);
snprintf(tmp_output, sizeof(tmp_output), "You got %s %d.", item_name,number);
clif_displaymessage(pl_sd->fd, tmp_output);
diff --git a/src/map/chrif.c b/src/map/chrif.c
index efe17fe29..d23bf8b52 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -36,6 +36,7 @@ static const int packet_len_table[0x20] = {
-1,-1,10, 6,11,-1, 0, 0, // 2b10-2b17
};
+int chrif_connected;
int char_fd = -1;
int srvinfo;
static char char_ip_str[16];
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 03ff83f6a..f2b258ea9 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -9,7 +9,7 @@ void chrif_setport(int);
int chrif_isconnect(void);
-int chrif_connected;
+extern int chrif_connected;
int chrif_authreq(struct map_session_data *);
int chrif_save(struct map_session_data*);
diff --git a/src/map/guild.c b/src/map/guild.c
index 5ce0d5d64..c65c3963c 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -158,7 +158,7 @@ void do_init_guild(void)
// 検索
struct guild *guild_search(int guild_id)
{
- return numdb_search(guild_db,guild_id);
+ return (struct guild *) numdb_search(guild_db,guild_id);
}
int guild_searchname_sub(void *key,void *data,va_list ap)
{
@@ -179,7 +179,7 @@ struct guild* guild_searchname(char *str)
}
struct guild_castle *guild_castle_search(int gcid)
{
- return numdb_search(castle_db,gcid);
+ return (struct guild_castle *) numdb_search(castle_db,gcid);
}
// mapnameに対応したアジトのgcを返す
@@ -336,7 +336,7 @@ int guild_created(int account_id,int guild_id)
struct guild *g;
sd->status.guild_id=guild_id;
sd->guild_sended=0;
- if((g=numdb_search(guild_db,guild_id))!=NULL){
+ if((g=(struct guild *) numdb_search(guild_db,guild_id))!=NULL){
printf("guild: id already exists!\n");
exit(1);
}
@@ -386,7 +386,7 @@ int guild_check_member(const struct guild *g)
nullpo_retr(0, g);
for(i=0;i<fd_max;i++){
- if(session[i] && (sd=session[i]->session_data) && sd->state.auth){
+ if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth){
if(sd->status.guild_id==g->guild_id){
int j,f=1;
for(j=0;j<MAX_GUILD;j++){ // データがあるか
@@ -412,7 +412,7 @@ int guild_recv_noinfo(int guild_id)
int i;
struct map_session_data *sd;
for(i=0;i<fd_max;i++){
- if(session[i] && (sd=session[i]->session_data) && sd->state.auth){
+ if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth){
if(sd->status.guild_id==guild_id)
sd->status.guild_id=0;
}
@@ -428,7 +428,7 @@ int guild_recv_info(struct guild *sg)
nullpo_retr(0, sg);
- if((g=numdb_search(guild_db,sg->guild_id))==NULL){
+ if((g=(struct guild *) numdb_search(guild_db,sg->guild_id))==NULL){
g=(struct guild *)aCalloc(1,sizeof(struct guild));
numdb_insert(guild_db,sg->guild_id,g);
before=*sg;
@@ -479,7 +479,7 @@ int guild_recv_info(struct guild *sg)
}
// イベントの発生
- if( (ev=numdb_search(guild_infoevent_db,sg->guild_id))!=NULL ){
+ if( (ev=(struct eventlist *)numdb_search(guild_infoevent_db,sg->guild_id))!=NULL ){
numdb_erase(guild_infoevent_db,sg->guild_id);
while(ev){
npc_event_do(ev->name);
@@ -948,7 +948,7 @@ int guild_payexp(struct map_session_data *sd,int exp)
if( (exp2=exp*per/100)<=0 )
return 0;
- if( (c=numdb_search(guild_expcache_db,sd->status.char_id))==NULL ){
+ if( (c=(struct guild_expcache *) numdb_search(guild_expcache_db,sd->status.char_id))==NULL ){
c=(struct guild_expcache *)aCallocA(1,sizeof(struct guild_expcache));
c->guild_id=sd->status.guild_id;
c->account_id=sd->status.account_id;
@@ -972,7 +972,7 @@ int guild_getexp(struct map_session_data *sd,int exp)
if(sd->status.guild_id==0 || (g=guild_search(sd->status.guild_id))==NULL )
return 0;
- if( (c=numdb_search(guild_expcache_db,sd->status.char_id))==NULL ){
+ if( (c=(struct guild_expcache *) numdb_search(guild_expcache_db,sd->status.char_id))==NULL ){
c=(struct guild_expcache *)aCallocA(1,sizeof(struct guild_expcache));
c->guild_id=sd->status.guild_id;
c->account_id=sd->status.account_id;
@@ -1377,7 +1377,7 @@ int guild_addcastleinfoevent(int castle_id,int index,const char *name)
ev=(struct eventlist *)aCalloc(1,sizeof(struct eventlist));
memcpy(ev->name,name,sizeof(ev->name));
- ev->next=numdb_search(guild_castleinfoevent_db,code);
+ ev->next=(struct eventlist *) numdb_search(guild_castleinfoevent_db,code);
numdb_insert(guild_castleinfoevent_db,code,ev);
return 0;
}
@@ -1422,7 +1422,7 @@ int guild_castledataloadack(int castle_id,int index,int value)
printf("guild_castledataloadack ERROR!! (Not found index=%d)\n", index);
return 0;
}
- if( (ev=numdb_search(guild_castleinfoevent_db,code))!=NULL ){
+ if( (ev=(struct eventlist *) numdb_search(guild_castleinfoevent_db,code))!=NULL ){
numdb_erase(guild_castleinfoevent_db,code);
while(ev){
npc_event_do(ev->name);
@@ -1668,7 +1668,7 @@ int guild_isallied(struct guild *g, struct guild_castle *gc)
static int guild_db_final(void *key,void *data,va_list ap)
{
- struct guild *g=data;
+ struct guild *g=(struct guild *) data;
aFree(g);
@@ -1676,7 +1676,7 @@ static int guild_db_final(void *key,void *data,va_list ap)
}
static int castle_db_final(void *key,void *data,va_list ap)
{
- struct guild_castle *gc=data;
+ struct guild_castle *gc=(struct guild_castle *) data;
aFree(gc);
@@ -1684,7 +1684,7 @@ static int castle_db_final(void *key,void *data,va_list ap)
}
static int guild_expcache_db_final(void *key,void *data,va_list ap)
{
- struct guild_expcache *c=data;
+ struct guild_expcache *c=(struct guild_expcache *) data;
aFree(c);
@@ -1692,7 +1692,7 @@ static int guild_expcache_db_final(void *key,void *data,va_list ap)
}
static int guild_infoevent_db_final(void *key,void *data,va_list ap)
{
- struct eventlist *ev=data;
+ struct eventlist *ev=(struct eventlist *) data;
aFree(ev);
diff --git a/src/map/intif.c b/src/map/intif.c
index d3d5188a2..3aa472ad8 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -645,8 +645,8 @@ int intif_parse_WisMessage(int fd) { // rewritten by [Yor]
// if(battle_config.etc_log)
// printf("intif_parse_wismessage: %d %s %s %s\n",id,RFIFOP(fd,6),RFIFOP(fd,30),RFIFOP(fd,54) );
- sd=map_nick2sd(RFIFOP(fd,32)); // 送信先を探す
- if(sd!=NULL && strcmp(sd->status.name, RFIFOP(fd,32)) == 0){
+ sd=(struct map_session_data *) map_nick2sd((char *) RFIFOP(fd,32)); // 送信先を探す
+ if(sd!=NULL && strcmp((char *) sd->status.name, (char *) RFIFOP(fd,32)) == 0){
/*
for(i=0;i<MAX_WIS_REFUSAL;i++){ //拒否リストに名前があるかどうか判定してあれば拒否
if(strcmp(sd->wis_refusal[i],RFIFOP(fd,8))==0){
@@ -664,7 +664,7 @@ int intif_parse_WisMessage(int fd) { // rewritten by [Yor]
else{
*/
else {
- wisp_source = RFIFOP(fd,8); // speed up [Yor]
+ wisp_source = (char *) RFIFOP(fd,8); // speed up [Yor]
for(i=0;i<MAX_IGNORE_LIST;i++){ //拒否リストに名前があるかどうか判定してあれば拒否
if(strcmp(sd->ignore[i].name, wisp_source)==0){
break;
@@ -689,7 +689,7 @@ int intif_parse_WisEnd(int fd) {
if (battle_config.etc_log)
printf("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
- sd = map_nick2sd(RFIFOP(fd,2));
+ sd = (struct map_session_data *)map_nick2sd((char *) RFIFOP(fd,2));
if (sd != NULL)
clif_wis_end(sd->fd, RFIFOB(fd,26));
@@ -702,7 +702,7 @@ int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B
struct map_session_data *pl_sd;
char Wisp_name[24];
char mbuf[255];
- char *message = ((RFIFOW(fd,2) - 30) >= sizeof(mbuf)) ? (char *) aMallocA((RFIFOW(fd,2) - 30)) : mbuf;
+ char *message = (char *) (((RFIFOW(fd,2) - 30) >= sizeof(mbuf)) ? (char *) aMallocA((RFIFOW(fd,2) - 30)) : mbuf);
min_gm_level = (int)RFIFOW(fd,28);
memcpy(Wisp_name, RFIFOP(fd,4), 24);
@@ -711,7 +711,7 @@ int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B
message[sizeof(message) - 1] = '\0';
// information is sended to all online GM
for (i = 0; i < fd_max; i++)
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth)
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth)
if (pc_isGM(pl_sd) >= min_gm_level)
clif_wis_message(i, Wisp_name, message, strlen(message) + 1);
@@ -831,7 +831,7 @@ int intif_parse_PartyCreated(int fd)
{
if(battle_config.etc_log)
printf("intif: party created\n");
- party_created(RFIFOL(fd,2),RFIFOB(fd,6),RFIFOL(fd,7),RFIFOP(fd,11));
+ party_created(RFIFOL(fd,2), RFIFOB(fd,6),RFIFOL(fd,7),(char *) RFIFOP(fd,11));
return 0;
}
// パーティ情報
@@ -871,7 +871,7 @@ int intif_parse_PartyMemberLeaved(int fd)
{
if(battle_config.etc_log)
printf("intif: party member leaved %d %d %s\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10));
- party_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10));
+ party_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),(char *) RFIFOP(fd,10));
return 0;
}
// パーティ解散通知
@@ -885,7 +885,7 @@ int intif_parse_PartyMove(int fd)
{
// if(battle_config.etc_log)
// printf("intif: party move %d %d %s %d %d\n",RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10),RFIFOB(fd,26),RFIFOW(fd,27));
- party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10),RFIFOB(fd,26),RFIFOW(fd,27));
+ party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),(char *) RFIFOP(fd,10),RFIFOB(fd,26),RFIFOW(fd,27));
return 0;
}
// パーティメッセージ
@@ -893,7 +893,7 @@ int intif_parse_PartyMessage(int fd)
{
// if(battle_config.etc_log)
// printf("intif_parse_PartyMessage: %s\n",RFIFOP(fd,12));
- party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12),RFIFOW(fd,2)-12);
+ party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
return 0;
}
@@ -934,7 +934,7 @@ int intif_parse_GuildMemberAdded(int fd)
int intif_parse_GuildMemberLeaved(int fd)
{
guild_member_leaved(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),
- RFIFOP(fd,55),RFIFOP(fd,15));
+ (char *) RFIFOP(fd,55), (char *) RFIFOP(fd,15));
return 0;
}
@@ -1011,25 +1011,25 @@ int intif_parse_GuildSkillUp(int fd)
int intif_parse_GuildAlliance(int fd)
{
guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),
- RFIFOB(fd,18),RFIFOP(fd,19),RFIFOP(fd,43));
+ RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43));
return 0;
}
// ギルド告知変更通知
int intif_parse_GuildNotice(int fd)
{
- guild_notice_changed(RFIFOL(fd,2),RFIFOP(fd,6),RFIFOP(fd,66));
+ guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66));
return 0;
}
// ギルドエンブレム変更通知
int intif_parse_GuildEmblem(int fd)
{
- guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12));
+ guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12));
return 0;
}
// ギルド会話受信
int intif_parse_GuildMessage(int fd)
{
- guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12),RFIFOW(fd,2)-12);
+ guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12);
return 0;
}
// ギルド城データ要求返信
@@ -1118,7 +1118,7 @@ int intif_parse(int fd)
}
// 処理分岐
switch(cmd){
- case 0x3800: clif_GMmessage(NULL,RFIFOP(fd,4),packet_len-4,0); break;
+ case 0x3800: clif_GMmessage(NULL,(char *) RFIFOP(fd,4),packet_len-4,0); break;
case 0x3801: intif_parse_WisMessage(fd); break;
case 0x3802: intif_parse_WisEnd(fd); break;
case 0x3803: mapif_parse_WisToGM(fd); break;
diff --git a/src/map/mail.c b/src/map/mail.c
index 91fed5f39..c7939cca1 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -305,7 +305,7 @@ int mail_check_timer(int tid,unsigned int tick,int id,int data)
while ((mail_row = mysql_fetch_row(mail_res))) {
for (i = 0; i < fd_max; i++) {
- if (session[i] && (sd = session[i]->session_data) && sd->state.auth){
+ if (session[i] && (sd = (struct map_session_data *) session[i]->session_data) && sd->state.auth){
if(pc_isGM(sd) < 80 && sd->mail_counter > 0)
sd->mail_counter--;
if(sd->status.account_id==atoi(mail_row[0]))
diff --git a/src/map/party.c b/src/map/party.c
index 5caff4be1..e33dc37cc 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -49,7 +49,7 @@ void do_init_party(void)
// 検索
struct party *party_search(int party_id)
{
- return numdb_search(party_db,party_id);
+ return (struct party *) numdb_search(party_db,party_id);
}
int party_searchname_sub(void *key,void *data,va_list ap)
{
@@ -91,7 +91,7 @@ int party_created(int account_id,int fail,int party_id,char *name)
if(fail==0){
struct party *p;
sd->status.party_id=party_id;
- if((p=numdb_search(party_db,party_id))!=NULL){
+ if((p=(struct party *) numdb_search(party_db,party_id))!=NULL){
printf("party: id already exists!\n");
exit(1);
}
@@ -121,7 +121,7 @@ int party_check_member(struct party *p)
nullpo_retr(0, p);
for(i=0;i<fd_max;i++){
- if(session[i] && (sd=session[i]->session_data) && sd->state.auth){
+ if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth){
if(sd->status.party_id==p->party_id){
int j,f=1;
for(j=0;j<MAX_PARTY;j++){ // パーティにデータがあるか確認
@@ -149,7 +149,7 @@ int party_recv_noinfo(int party_id)
int i;
struct map_session_data *sd;
for(i=0;i<fd_max;i++){
- if(session[i] && (sd=session[i]->session_data) && sd->state.auth){
+ if(session[i] && (sd=(struct map_session_data *) session[i]->session_data) && sd->state.auth){
if(sd->status.party_id==party_id)
sd->status.party_id=0;
}
@@ -164,7 +164,7 @@ int party_recv_info(struct party *sp)
nullpo_retr(0, sp);
- if((p=numdb_search(party_db,sp->party_id))==NULL){
+ if((p=(struct party *) numdb_search(party_db,sp->party_id))==NULL){
p=(struct party *)aCalloc(1,sizeof(struct party));
numdb_insert(party_db,sp->party_id,p);
diff --git a/src/map/pet.c b/src/map/pet.c
index 0a8a44e10..9df62c70e 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -1650,7 +1650,7 @@ int read_petdb()
pet_db[j].script = NULL;
if((np=strchr(p,'{'))==NULL)
continue;
- pet_db[j].script = parse_script(np,lines);
+ pet_db[j].script = parse_script((unsigned char *) np,lines);
j++;
}
fclose(fp);
diff --git a/src/map/script.c b/src/map/script.c
index 16b74c45b..980b552af 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2905,7 +2905,7 @@ int buildin_getequipname(struct script_state *st)
}else{
sprintf(buf,"%s-[%s]",pos[num-1],pos[10]);
}
- push_str(st->stack,C_STR,buf);
+ push_str(st->stack,C_STR,(unsigned char *) buf);
return 0;
}
@@ -3668,7 +3668,7 @@ int buildin_gettimestr(struct script_state *st)
strftime(tmpstr,maxlen,fmtstr,localtime(&now));
tmpstr[maxlen]='\0';
- push_str(st->stack,C_STR,tmpstr);
+ push_str(st->stack,C_STR,(unsigned char *) tmpstr);
return 0;
}
@@ -4178,7 +4178,7 @@ int buildin_getusersname(struct script_state *st)
int i=0,disp_num=1;
for (i=0;i<fd_max;i++)
- if(session[i] && (pl_sd=session[i]->session_data) && pl_sd->state.auth){
+ if(session[i] && (pl_sd=(struct map_session_data *) session[i]->session_data) && pl_sd->state.auth){
if( !(battle_config.hide_GM_session && pc_isGM(pl_sd)) ){
if((disp_num++)%10==0)
clif_scriptnext(script_rid2sd(st),st->oid);
@@ -4725,13 +4725,13 @@ int buildin_getwaitingroomstate(struct script_state *st)
case 33: val=(cd->users >= cd->trigger); break;
case 4:
- push_str(st->stack,C_CONSTSTR,cd->title);
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) cd->title);
return 0;
case 5:
- push_str(st->stack,C_CONSTSTR,cd->pass);
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) cd->pass);
return 0;
case 16:
- push_str(st->stack,C_CONSTSTR,cd->npc_event);
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) cd->npc_event);
return 0;
}
push_val(st->stack,C_INT,val);
@@ -4763,7 +4763,7 @@ int buildin_warpwaitingpc(struct script_state *st)
for(i=0;i<n;i++){
struct map_session_data *sd=cd->usersd[0]; // リスト先頭のPCを次々に。
- mapreg_setreg(add_str("$@warpwaitingpc")+(i<<24),sd->bl.id);
+ mapreg_setreg(add_str((unsigned char *) "$@warpwaitingpc")+(i<<24),sd->bl.id);
if(strcmp(str,"Random")==0)
pc_randomwarp(sd,3);
@@ -4776,7 +4776,7 @@ int buildin_warpwaitingpc(struct script_state *st)
}else
pc_setpos(sd,str,x,y,0);
}
- mapreg_setreg(add_str("$@warpwaitingpcnum"),n);
+ mapreg_setreg(add_str((unsigned char *) "$@warpwaitingpcnum"),n);
return 0;
}
/*==========================================
@@ -5019,7 +5019,7 @@ int buildin_pvpon(struct script_state *st)
return 0;
for(i=0;i<fd_max;i++){ //人数分ループ
- if(session[i] && (pl_sd=session[i]->session_data) && pl_sd->state.auth){
+ if(session[i] && (pl_sd=(struct map_session_data *) session[i]->session_data) && pl_sd->state.auth){
if(m == pl_sd->bl.m && pl_sd->pvp_timer == -1) {
pl_sd->pvp_timer=add_timer(gettick()+200,pc_calc_pvprank_timer,pl_sd->bl.id,0);
pl_sd->pvp_rank=0;
@@ -5049,7 +5049,7 @@ int buildin_pvpoff(struct script_state *st)
return 0;
for(i=0;i<fd_max;i++){ //人数分ループ
- if(session[i] && (pl_sd=session[i]->session_data) && pl_sd->state.auth){
+ if(session[i] && (pl_sd=(struct map_session_data *) session[i]->session_data) && pl_sd->state.auth){
if(m == pl_sd->bl.m) {
clif_pvpset(pl_sd,0,0,2);
if(pl_sd->pvp_timer != -1) {
@@ -5178,8 +5178,8 @@ int buildin_agitcheck(struct script_state *st)
if (agit_flag==0) push_val(st->stack,C_INT,0);
} else {
sd=script_rid2sd(st);
- if (agit_flag==1) pc_setreg(sd,add_str("@agit_flag"),1);
- if (agit_flag==0) pc_setreg(sd,add_str("@agit_flag"),0);
+ if (agit_flag==1) pc_setreg(sd,add_str((unsigned char *) "@agit_flag"),1);
+ if (agit_flag==0) pc_setreg(sd,add_str((unsigned char *) "@agit_flag"),0);
}
return 0;
}
@@ -5210,9 +5210,9 @@ int buildin_getcastlename(struct script_state *st)
}
}
if(buf)
- push_str(st->stack,C_STR,buf);
+ push_str(st->stack,C_STR,(unsigned char *) buf);
else
- push_str(st->stack,C_CONSTSTR,"");
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
return 0;
}
@@ -5672,21 +5672,21 @@ int buildin_strmobinfo(struct script_state *st)
case 1:
{
char *buf;
- buf=aCallocA(24, 1);
+ buf=(char *) aCallocA(24, 1);
// buf=mob_db[class_].name;
// for string assignments you would need to go for c++ [Shinomori]
strcpy(buf,mob_db[class_].name);
- push_str(st->stack,C_STR,buf);
+ push_str(st->stack,C_STR,(unsigned char *) buf);
break;
}
case 2:
{
char *buf;
- buf=aCallocA(24, 1);
+ buf=(char *) aCallocA(24, 1);
// buf=mob_db[class_].jname;
// for string assignments you would need to go for c++ [Shinomori]
strcpy(buf,mob_db[class_].jname);
- push_str(st->stack,C_STR,buf);
+ push_str(st->stack,C_STR,(unsigned char *) buf);
break;
}
case 3:
@@ -5771,7 +5771,7 @@ int buildin_getitemname(struct script_state *st)
item_name=(char *)aCallocA(24,sizeof(char));
strncpy(item_name,i_data->jname,23);
- push_str(st->stack,C_STR,item_name);
+ push_str(st->stack,C_STR,(unsigned char *) item_name);
return 0;
}
@@ -5854,20 +5854,20 @@ int buildin_getinventorylist(struct script_state *st)
if(!sd) return 0;
for(i=0;i<MAX_INVENTORY;i++){
if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].amount > 0){
- pc_setreg(sd,add_str("@inventorylist_id")+(j<<24),sd->status.inventory[i].nameid);
- pc_setreg(sd,add_str("@inventorylist_amount")+(j<<24),sd->status.inventory[i].amount);
- pc_setreg(sd,add_str("@inventorylist_equip")+(j<<24),sd->status.inventory[i].equip);
- pc_setreg(sd,add_str("@inventorylist_refine")+(j<<24),sd->status.inventory[i].refine);
- pc_setreg(sd,add_str("@inventorylist_identify")+(j<<24),sd->status.inventory[i].identify);
- pc_setreg(sd,add_str("@inventorylist_attribute")+(j<<24),sd->status.inventory[i].attribute);
- pc_setreg(sd,add_str("@inventorylist_card1")+(j<<24),sd->status.inventory[i].card[0]);
- pc_setreg(sd,add_str("@inventorylist_card2")+(j<<24),sd->status.inventory[i].card[1]);
- pc_setreg(sd,add_str("@inventorylist_card3")+(j<<24),sd->status.inventory[i].card[2]);
- pc_setreg(sd,add_str("@inventorylist_card4")+(j<<24),sd->status.inventory[i].card[3]);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_id")+(j<<24),sd->status.inventory[i].nameid);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_amount")+(j<<24),sd->status.inventory[i].amount);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_equip")+(j<<24),sd->status.inventory[i].equip);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_refine")+(j<<24),sd->status.inventory[i].refine);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_identify")+(j<<24),sd->status.inventory[i].identify);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_attribute")+(j<<24),sd->status.inventory[i].attribute);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_card1")+(j<<24),sd->status.inventory[i].card[0]);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_card2")+(j<<24),sd->status.inventory[i].card[1]);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_card3")+(j<<24),sd->status.inventory[i].card[2]);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_card4")+(j<<24),sd->status.inventory[i].card[3]);
j++;
}
}
- pc_setreg(sd,add_str("@inventorylist_count"),j);
+ pc_setreg(sd,add_str((unsigned char *) "@inventorylist_count"),j);
return 0;
}
@@ -5878,13 +5878,13 @@ int buildin_getskilllist(struct script_state *st)
if(!sd) return 0;
for(i=0;i<MAX_SKILL;i++){
if(sd->status.skill[i].id > 0 && sd->status.skill[i].lv > 0){
- pc_setreg(sd,add_str("@skilllist_id")+(j<<24),sd->status.skill[i].id);
- pc_setreg(sd,add_str("@skilllist_lv")+(j<<24),sd->status.skill[i].lv);
- pc_setreg(sd,add_str("@skilllist_flag")+(j<<24),sd->status.skill[i].flag);
+ pc_setreg(sd,add_str((unsigned char *) "@skilllist_id")+(j<<24),sd->status.skill[i].id);
+ pc_setreg(sd,add_str((unsigned char *)"@skilllist_lv")+(j<<24),sd->status.skill[i].lv);
+ pc_setreg(sd,add_str((unsigned char *)"@skilllist_flag")+(j<<24),sd->status.skill[i].flag);
j++;
}
}
- pc_setreg(sd,add_str("@skilllist_count"),j);
+ pc_setreg(sd,add_str((unsigned char *) "@skilllist_count"),j);
return 0;
}
@@ -6211,7 +6211,7 @@ int buildin_recovery(struct script_state *st)
int i = 0;
for (i = 0; i < fd_max; i++) {
if (session[i]){
- struct map_session_data *sd = session[i]->session_data;
+ struct map_session_data *sd = (struct map_session_data *) session[i]->session_data;
if (sd && sd->state.auth) {
sd->status.hp = sd->status.max_hp;
sd->status.sp = sd->status.max_sp;
@@ -6251,7 +6251,7 @@ int buildin_getpetinfo(struct script_state *st)
break;
case 2:
if(sd->pet.name)
- push_str(st->stack,C_STR,sd->pet.name);
+ push_str(st->stack,C_STR,(unsigned char *) sd->pet.name);
else
push_val(st->stack,C_INT,0);
break;
@@ -6348,8 +6348,8 @@ int buildin_select(struct script_state *st)
sd->state.menu_or_input=0;
st->state=END;
} else {
- pc_setreg(sd,add_str("l15"),sd->npc_menu);
- pc_setreg(sd,add_str("@menu"),sd->npc_menu);
+ pc_setreg(sd,add_str((unsigned char *) "l15"),sd->npc_menu);
+ pc_setreg(sd,add_str((unsigned char *) "@menu"),sd->npc_menu);
sd->state.menu_or_input=0;
push_val(st->stack,C_INT,sd->npc_menu);
}
@@ -6595,14 +6595,14 @@ int buildin_getsavepoint(struct script_state *st)
sd=script_rid2sd(st);
type=conv_num(st,& (st->stack->stack_data[st->start+2]));
- mapname=aCallocA(24, 1);
+ mapname=(char *) aCallocA(24, 1);
x=sd->status.save_point.x;
y=sd->status.save_point.y;
strncpy(mapname,sd->status.save_point.map,24);
switch(type){
case 0:
- push_str(st->stack,C_STR,mapname);
+ push_str(st->stack,C_STR,(unsigned char *) mapname);
break;
case 1:
push_val(st->stack,C_INT,x);
@@ -6664,7 +6664,7 @@ int buildin_getmapxy(struct script_state *st){
//??????????? >>> Possible needly check function parameters on C_STR,C_INT,C_INT <<< ???????????//
type=conv_num(st,& (st->stack->stack_data[st->start+5]));
- mapname=aCallocA(24, 1);
+ mapname=(char *) aCallocA(24, 1);
switch (type){
case 0: //Get Character Position
@@ -7397,7 +7397,7 @@ int run_script_main(char *script,int pos,int rid,int oid,struct script_state *st
rerun_pos=st->pos;
for(st->state=0;st->state==0;){
- switch(c=get_com(script,&st->pos)){
+ switch(c= get_com((unsigned char *) script,&st->pos)){
case C_EOL:
if(stack->sp!=st->defsp){
if(battle_config.error_log)
@@ -7407,7 +7407,7 @@ int run_script_main(char *script,int pos,int rid,int oid,struct script_state *st
rerun_pos=st->pos;
break;
case C_INT:
- push_val(stack,C_INT,get_num(script,&st->pos));
+ push_val(stack,C_INT,get_num((unsigned char *) script,&st->pos));
break;
case C_POS:
case C_NAME:
@@ -7418,7 +7418,7 @@ int run_script_main(char *script,int pos,int rid,int oid,struct script_state *st
push_val(stack,c,0);
break;
case C_STR:
- push_str(stack,C_CONSTSTR,script+st->pos);
+ push_str(stack,C_CONSTSTR,(unsigned char *) (script+st->pos));
while(script[st->pos++]);
break;
case C_FUNC:
@@ -7578,7 +7578,7 @@ int mapreg_setregstr(int num,const char *str)
{
char *p;
- if( (p=numdb_search(mapregstr_db,num))!=NULL )
+ if( (p=(char *) numdb_search(mapregstr_db,num))!=NULL )
aFree(p);
if( str==NULL || *str==0 ){
@@ -7618,14 +7618,14 @@ static int script_load_mapreg()
}
p=(char *)aCallocA(strlen(buf2) + 1,sizeof(char));
strcpy(p,buf2);
- s=add_str(buf1);
+ s= add_str((unsigned char *) buf1);
numdb_insert(mapregstr_db,(i<<24)|s,p);
}else{
if( sscanf(line+n,"%d",&v)!=1 ){
printf("%s: %s broken data !\n",mapreg_txt,buf1);
continue;
}
- s=add_str(buf1);
+ s= add_str((unsigned char *) buf1);
numdb_insert(mapreg_db,(i<<24)|s,v);
}
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 31b46820b..8420f0ac5 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5261,7 +5261,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
group->interval=interval;
if(skillid==HT_TALKIEBOX ||
skillid==RG_GRAFFITI){
- group->valstr=aCallocA(80, 1);
+ group->valstr=(char *) aCallocA(80, 1);
if(group->valstr==NULL){
printf("skill_castend_map: out of memory !\n");
exit(1);
@@ -5878,7 +5878,7 @@ int skill_unit_onlimit(struct skill_unit *src,unsigned int tick)
src->bl.x,src->bl.y,1);
if(group == NULL)
return 0;
- group->valstr=aCallocA(24, 1);
+ group->valstr=(char *) aCallocA(24, 1);
if(group->valstr==NULL){
printf("skill_unit_onlimit: out of memory !\n");
exit(1);
@@ -8563,7 +8563,7 @@ int skill_unit_move_unit_group( struct skill_unit_group *group, int m,int dx,int
group->skill_id!=HT_CLAYMORETRAP && group->skill_id!=HT_BLASTMINE)
return 0;
- m_flag = malloc(sizeof(int)*group->unit_count);
+ m_flag = (int *) aMalloc(sizeof(int)*group->unit_count);
memset(m_flag,0,sizeof(int)*group->unit_count);// 移動フラグ
// 先にフラグを全部決める
// m_flag
@@ -9524,7 +9524,7 @@ static int skill_read_skillspamount(void)
struct skill_db *skill = NULL;
int s, idx, new_flag=1, level=1, sp=0;
- buf=grfio_reads("data\\leveluseskillspamount.txt",&s);
+ buf=(char *) grfio_reads("data\\leveluseskillspamount.txt",&s);
if(buf==NULL)
return -1;
diff --git a/src/map/storage.c b/src/map/storage.c
index c9f4ffd62..6c4d6bea7 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -67,13 +67,13 @@ int do_init_storage(void) // map.c::do_init()から呼ばれる
}
static int guild_storage_db_final(void *key,void *data,va_list ap)
{
- struct guild_storage *gstor=data;
+ struct guild_storage *gstor=(struct guild_storage *) data;
aFree(gstor);
return 0;
}
static int storage_db_final(void *key,void *data,va_list ap)
{
- struct storage *stor=data;
+ struct storage *stor=(struct storage *) data;
aFree(stor);
return 0;
}
@@ -88,9 +88,9 @@ void do_final_storage(void) // by [MC Cameri]
struct storage *account2storage(int account_id)
{
struct storage *stor;
- stor=numdb_search(storage_db,account_id);
+ stor=(struct storage *) numdb_search(storage_db,account_id);
if(stor == NULL) {
- stor = aCallocA(sizeof(struct storage), 1);
+ stor = (struct storage *) aCallocA(sizeof(struct storage), 1);
if(stor == NULL){
printf("storage: out of memory!\n");
exit(0);
@@ -104,12 +104,12 @@ struct storage *account2storage(int account_id)
// Just to ask storage, without creation
struct storage *account2storage2(int account_id) {
- return numdb_search(storage_db, account_id);
+ return (struct storage *) numdb_search(storage_db, account_id);
}
int storage_delete(int account_id)
{
- struct storage *stor = numdb_search(storage_db,account_id);
+ struct storage *stor = (struct storage *) numdb_search(storage_db,account_id);
if(stor) {
numdb_erase(storage_db,account_id);
aFree(stor);
@@ -131,7 +131,7 @@ int storage_storageopen(struct map_session_data *sd)
clif_displaymessage(sd->fd, msg_txt(246));
return 1;
}
- if((stor = numdb_search(storage_db,sd->status.account_id)) != NULL) {
+ if((stor = (struct storage *) numdb_search(storage_db,sd->status.account_id)) != NULL) {
if (stor->storage_status == 0) {
stor->storage_status = 1;
sd->state.storage_flag = 0;
@@ -348,7 +348,7 @@ int storage_storage_quit(struct map_session_data *sd)
nullpo_retr(0, sd);
- stor = numdb_search(storage_db,sd->status.account_id);
+ stor = (struct storage *) numdb_search(storage_db,sd->status.account_id);
if(stor) {
stor->storage_status = 0;
storage_storage_save(sd);
@@ -361,7 +361,7 @@ void storage_storage_dirty(struct map_session_data *sd)
{
struct storage *stor;
- stor=numdb_search(storage_db,sd->status.account_id);
+ stor=(struct storage *) numdb_search(storage_db,sd->status.account_id);
if(stor)
stor->dirty = 1;
@@ -373,7 +373,7 @@ int storage_storage_save(struct map_session_data *sd)
nullpo_retr(0, sd);
- stor=numdb_search(storage_db,sd->status.account_id);
+ stor=(struct storage *) numdb_search(storage_db,sd->status.account_id);
if(stor && stor->dirty) {
intif_send_storage(stor);
stor->dirty = 0;
@@ -386,9 +386,9 @@ struct guild_storage *guild2storage(int guild_id)
{
struct guild_storage *gs = NULL;
if(guild_search(guild_id) != NULL) {
- gs=numdb_search(guild_storage_db,guild_id);
+ gs=(struct guild_storage *) numdb_search(guild_storage_db,guild_id);
if(gs == NULL) {
- gs = aCallocA(sizeof(struct guild_storage), 1);
+ gs = (struct guild_storage *) aCallocA(sizeof(struct guild_storage), 1);
if(gs==NULL){
printf("storage: out of memory!\n");
exit(0);
@@ -402,7 +402,7 @@ struct guild_storage *guild2storage(int guild_id)
int guild_storage_delete(int guild_id)
{
- struct guild_storage *gstor = numdb_search(guild_storage_db,guild_id);
+ struct guild_storage *gstor = (struct guild_storage *) numdb_search(guild_storage_db,guild_id);
if(gstor) {
numdb_erase(guild_storage_db,guild_id);
aFree(gstor);
@@ -418,7 +418,7 @@ int storage_guild_storageopen(struct map_session_data *sd)
if(sd->status.guild_id <= 0)
return 2;
- if((gstor = numdb_search(guild_storage_db,sd->status.guild_id)) != NULL) {
+ if((gstor = (struct guild_storage *) numdb_search(guild_storage_db,sd->status.guild_id)) != NULL) {
if(gstor->storage_status)
return 1;
gstor->storage_status = 1;
@@ -608,7 +608,7 @@ int storage_guild_storage_quit(struct map_session_data *sd,int flag)
nullpo_retr(0, sd);
- stor = numdb_search(guild_storage_db,sd->status.guild_id);
+ stor = (struct guild_storage *) numdb_search(guild_storage_db,sd->status.guild_id);
if(stor) {
if(!flag)
intif_send_guild_storage(sd->status.account_id,stor);