summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-05-14 02:24:49 +0000
committerFate <fate-tmw@googlemail.com>2009-05-14 02:24:49 +0000
commitf5f588157c209bc90f7c9f14ec4ed1403fdd1ee7 (patch)
tree0f2717916a49ae9e0d24ba041482f15c5118a727 /src/map
parent92c1c98824efb789709d70ee8d6d5ed6e49b47a3 (diff)
parent94a8a08118ecd9e358d794d430945ada248d0959 (diff)
downloadtmwa-f5f588157c209bc90f7c9f14ec4ed1403fdd1ee7.tar.gz
tmwa-f5f588157c209bc90f7c9f14ec4ed1403fdd1ee7.tar.bz2
tmwa-f5f588157c209bc90f7c9f14ec4ed1403fdd1ee7.tar.xz
tmwa-f5f588157c209bc90f7c9f14ec4ed1403fdd1ee7.zip
Merge branch 'master' of git@gitorious.org:tmw-eathena/mainline
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/chrif.h1
-rw-r--r--src/map/clif.c40
-rw-r--r--src/map/clif.h1
-rw-r--r--src/map/itemdb.c3
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/script.c13
-rw-r--r--src/map/skill.c4
-rw-r--r--src/map/tmw.c2
10 files changed, 31 insertions, 43 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 374db77..85ff15c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -574,7 +574,7 @@ void log_atcommand(struct map_session_data *sd, const char *fmt, ...)
sprintf(fullname, "%s.%04d-%02d", gm_logfile_name, year, month);
if (gm_logfile)
- close(gm_logfile);
+ fclose(gm_logfile);
gm_logfile = fopen(fullname, "a");
free(fullname);
@@ -6740,7 +6740,7 @@ int atcommand_summon(const int fd, struct map_session_data* sd, const char* comm
md->state.special_mob_ai=1;
md->mode=mob_db[md->class].mode|0x04;
md->deletetimer=add_timer(tick+60000,mob_timer_delete,id,0);
- clif_misceffect2(&md->bl,344);
+ clif_misceffect(&md->bl,344);
}
clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,x,y,tick);
@@ -7011,7 +7011,7 @@ int atcommand_jump_iterate(
memset(output, '\0', sizeof(output));
- pl_sd = map_id2bl(sd->followtarget);
+ pl_sd = (struct map_session_data*)map_id2bl(sd->followtarget);
if (pl_sd)
pl_sd = get_next(pl_sd);
diff --git a/src/map/battle.c b/src/map/battle.c
index f822c10..45524e5 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3792,6 +3792,8 @@ struct Damage battle_calc_attack( int attack_type,
struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int flag)
{
struct Damage d;
+ memset(&d, 0, sizeof(d));
+
switch(attack_type){
case BF_WEAPON:
return battle_calc_weapon_attack(bl,target,skill_num,skill_lv,flag);
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 19d725d..2a7b35e 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -23,6 +23,7 @@ int chrif_saveaccountreg2(struct map_session_data *sd);
int chrif_reloadGMdb(void);
int chrif_ragsrvinfo(int base_rate,int job_rate, int drop_rate);
int chrif_char_offline(struct map_session_data *sd);
+int chrif_send_divorce(int char_id);
int do_init_chrif(void);
diff --git a/src/map/clif.c b/src/map/clif.c
index e053357..e5fa002 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -676,6 +676,7 @@ int clif_clearchar_id(int id, int type, int fd) {
return 0;
}
+/*
static int current_weapon(struct map_session_data *sd)
{
if (sd->attack_spell_override)
@@ -684,6 +685,7 @@ static int current_weapon(struct map_session_data *sd)
return sd->status.weapon;
}
}
+*/
/*==========================================
*
@@ -2564,22 +2566,6 @@ int clif_misceffect(struct block_list* bl,int type)
return 0;
}
-int clif_misceffect2(struct block_list *bl, int type) {
- unsigned char buf[24];
-
- nullpo_retr(0, bl);
-
- memset(buf, 0, packet_len_table[0x1f3]);
-
- WBUFW(buf,0) = 0x1f3;
- WBUFL(buf,2) = bl->id;
- WBUFL(buf,6) = type;
-
- clif_send(buf, packet_len_table[0x1f3], bl, AREA);
-
- return 0;
-
-}
/*==========================================
* �\���I�v�V�����ύX
*------------------------------------------
@@ -3064,7 +3050,7 @@ int clif_updatestorageamount(struct map_session_data *sd,struct storage *stor)
*/
int clif_storageitemadded(struct map_session_data *sd,struct storage *stor,int index,int amount)
{
- int view,fd,j;
+ int fd,j;
nullpo_retr(0, sd);
nullpo_retr(0, stor);
@@ -3272,8 +3258,8 @@ void clif_getareachar_pc(struct map_session_data* sd,struct map_session_data* ds
if(sd->status.manner < 0)
clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner);
- clif_changelook_accessories(sd, dstsd);
- clif_changelook_accessories(dstsd, sd);
+ clif_changelook_accessories(&sd->bl, dstsd);
+ clif_changelook_accessories(&dstsd->bl, sd);
}
/*==========================================
@@ -3359,7 +3345,7 @@ int clif_fixpcpos(struct map_session_data *sd)
len = clif_set0078(sd,buf);
clif_send(buf,len,&sd->bl,AREA);
}
- clif_changelook_accessories(sd, NULL);
+ clif_changelook_accessories(&sd->bl, NULL);
return 0;
}
@@ -6082,9 +6068,9 @@ int clif_specialeffect(struct block_list *bl, int type, int flag) {
nullpo_retr(0, bl);
- memset(buf, 0, packet_len_table[0x1f3]);
+ memset(buf, 0, packet_len_table[0x19b]);
- WBUFW(buf,0) = 0x1f3;
+ WBUFW(buf,0) = 0x19b;
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = type;
@@ -6098,9 +6084,9 @@ int clif_specialeffect(struct block_list *bl, int type, int flag) {
}
else if (flag==1)
- clif_send(buf, packet_len_table[0x1f3], bl, SELF);
+ clif_send(buf, packet_len_table[0x19b], bl, SELF);
else if (!flag)
- clif_send(buf, packet_len_table[0x1f3], bl, AREA);
+ clif_send(buf, packet_len_table[0x19b], bl, AREA);
return 0;
@@ -6429,9 +6415,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
WFIFOSET(fd,packet_len_table[0x95]);
if (ssd->special_state.heal_effect)
{
- unsigned char buf[16];
-
- nullpo_retr(0, bl);
+ nullpo_retv(bl);
WFIFOW(fd,0)=0x0196;
WFIFOW(fd,2)=SC_HEALING;
@@ -6600,7 +6584,7 @@ void clif_parse_ChangeDir(int fd, struct map_session_data *sd) {
nullpo_retv(sd);
- RFIFOW(fd,2); //skip
+// RFIFOW(fd,2); // Apparently does nothing?
dir = RFIFOB(fd,4);
pc_setdir(sd, dir);
diff --git a/src/map/clif.h b/src/map/clif.h
index 078d1a6..198bbff 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -70,7 +70,6 @@ int clif_statusupack(struct map_session_data *,int,int,int); // self
int clif_equipitemack(struct map_session_data *,int,int,int); // self
int clif_unequipitemack(struct map_session_data *,int,int,int); // self
int clif_misceffect(struct block_list*,int); // area
-int clif_misceffect2(struct block_list *bl,int type);
int clif_changeoption(struct block_list*); // area
int clif_useitemack(struct map_session_data*,int,int,int); // self
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index d9f77d3..0acf181 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -383,7 +383,8 @@ static int itemdb_read_randomitem()
struct random_item_data *pd=data[i].pdata;
int *pc=data[i].pcount;
int *pdefault=data[i].pdefault;
- char *fn=data[i].filename;
+ const char *fn=data[i].filename;
+
*pdefault = 0;
if( (fp=fopen(fn,"r"))==NULL ){
diff --git a/src/map/pc.c b/src/map/pc.c
index cf1e101..9703ee0 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -17,6 +17,7 @@
#include "chat.h"
#include "chrif.h"
#include "clif.h"
+#include "guild.h"
#include "intif.h"
#include "itemdb.h"
#include "map.h"
@@ -1069,7 +1070,6 @@ int pc_calcstatus(struct map_session_data* sd,int first)
struct skill b_skill[MAX_SKILL];
int i,bl,index;
int skill,aspd_rate,wele,wele_,def_ele,refinedef=0;
- int pele=0,pdef_ele=0;
int str,dstr,dex;
struct pc_base_job s_class;
diff --git a/src/map/script.c b/src/map/script.c
index 9378e33..daf6374 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -13,6 +13,7 @@
#endif
#include <time.h>
+#include <math.h>
#include "socket.h"
#include "timer.h"
@@ -25,6 +26,7 @@
#include "chrif.h"
#include "clif.h"
#include "db.h"
+#include "guild.h"
#include "intif.h"
#include "itemdb.h"
#include "lock.h"
@@ -3175,7 +3177,7 @@ int buildin_skill(struct script_state *st)
*/
int buildin_setskill(struct script_state *st)
{
- int id,level,flag=1;
+ int id,level;
struct map_session_data *sd;
id=conv_num(st,& (st->stack->stack_data[st->start+2]));
@@ -3186,6 +3188,7 @@ int buildin_setskill(struct script_state *st)
sd->status.skill[id].lv = level;
sd->status.skill[id].flag = 0;
clif_skillinfoblock(sd);
+ return 0;
}
/*==========================================
@@ -5535,11 +5538,11 @@ int buildin_misceffect(struct script_state *st)
type=conv_num(st,& (st->stack->stack_data[st->start+2]));
if(st->oid)
- clif_misceffect2(map_id2bl(st->oid),type);
+ clif_misceffect(map_id2bl(st->oid),type);
else{
struct map_session_data *sd=script_rid2sd(st);
if(sd)
- clif_misceffect2(&sd->bl,type);
+ clif_misceffect(&sd->bl,type);
}
return 0;
}
@@ -5891,7 +5894,6 @@ int buildin_shop(struct script_state *st)
{
struct map_session_data *sd=script_rid2sd(st);
struct npc_data *nd;
- char *str;
if (!sd)
return 1;
@@ -5914,6 +5916,7 @@ int buildin_isdead(struct script_state *st)
struct map_session_data *sd=script_rid2sd(st);
push_val(st->stack, C_INT, pc_isdead(sd));
+ return 0;
}
//
@@ -6399,7 +6402,7 @@ int run_script_main(unsigned char *script,int pos,int rid,int oid,struct script_
*/
int run_script(unsigned char *script,int pos,int rid,int oid)
{
- run_script_l(script, pos, rid, oid, 0, NULL);
+ return run_script_l(script, pos, rid, oid, 0, NULL);
}
int run_script_l(unsigned char *script,int pos,int rid,int oid, int args_nr, argrec_t *args)
diff --git a/src/map/skill.c b/src/map/skill.c
index 4e5f9de..40eaeaa 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8156,7 +8156,7 @@ int skill_encchant_eremental_end(struct block_list *bl,int type)
*/
int skill_status_change_start(struct block_list *bl, int type, int val1, int val2, int val3, int val4, int tick, int flag)
{
- skill_status_effect(bl, type, val1, val2, val3, val4, tick, flag, 0);
+ return skill_status_effect(bl, type, val1, val2, val3, val4, tick, flag, 0);
}
@@ -9817,7 +9817,7 @@ int skill_unit_move_unit_group( struct skill_unit_group *group, int m,int dx,int
*/
int skill_readdb(void)
{
- int i,j,k,l,m;
+ int i,j,k,l;
FILE *fp;
char line[1024],*p;
diff --git a/src/map/tmw.c b/src/map/tmw.c
index 6a2df32..ba02189 100644
--- a/src/map/tmw.c
+++ b/src/map/tmw.c
@@ -106,8 +106,6 @@ void tmw_GmHackMsg(const char *fmt, ...) {
char buf[512];
va_list ap;
- buf[512] = 0;
-
va_start(ap, fmt);
vsnprintf(buf, 511, fmt, ap);
va_end(ap);