summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-26 18:49:46 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-01-26 18:49:46 +0000
commit66b2cadb9bcb6ad125cb18cdbea903a63ad0d925 (patch)
treed5fbc354d0db815d28c71e31f8e48b7e272d3ac4 /src
parent7924f0a9251dba9dbd7acae7d6bff3cb8610ab9b (diff)
downloadhercules-66b2cadb9bcb6ad125cb18cdbea903a63ad0d925.tar.gz
hercules-66b2cadb9bcb6ad125cb18cdbea903a63ad0d925.tar.bz2
hercules-66b2cadb9bcb6ad125cb18cdbea903a63ad0d925.tar.xz
hercules-66b2cadb9bcb6ad125cb18cdbea903a63ad0d925.zip
- Added a wrapper to delete_timer so it prints out from where the invocation was done.
- Fixed some unsigned warnings. - Fixed Splash attacks consuming 2 ammo on each attack. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9718 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char_sql/int_homun.c4
-rw-r--r--src/common/plugins.c3
-rw-r--r--src/common/socket.c2
-rw-r--r--src/common/timer.c6
-rw-r--r--src/common/timer.h4
-rw-r--r--src/map/skill.c1
6 files changed, 12 insertions, 8 deletions
diff --git a/src/char_sql/int_homun.c b/src/char_sql/int_homun.c
index 7fd27550a..3fc0ca8a4 100644
--- a/src/char_sql/int_homun.c
+++ b/src/char_sql/int_homun.c
@@ -183,9 +183,7 @@ int mapif_load_homunculus(int fd){
homun_pt->hunger = 0;
else if(homun_pt->hunger > 100)
homun_pt->hunger = 100;
- if(homun_pt->intimacy < 0)
- homun_pt->intimacy = 0;
- else if(homun_pt->intimacy > 100000)
+ if(homun_pt->intimacy > 100000)
homun_pt->intimacy = 100000;
mysql_free_result(sql_res);
diff --git a/src/common/plugins.c b/src/common/plugins.c
index 09ce15da3..ac8c4a7ee 100644
--- a/src/common/plugins.c
+++ b/src/common/plugins.c
@@ -346,7 +346,8 @@ void plugins_init(void)
export_symbol(addr_, SYMBOL_ADDR);
// timers
export_symbol(get_uptime, SYMBOL_GET_UPTIME);
- export_symbol(delete_timer, SYMBOL_DELETE_TIMER);
+// export_symbol(delete_timer, SYMBOL_DELETE_TIMER);
+ export_symbol(delete_timer_sub, SYMBOL_DELETE_TIMER);
export_symbol(add_timer_func_list, SYMBOL_ADD_TIMER_FUNC_LIST);
export_symbol(add_timer_interval, SYMBOL_ADD_TIMER_INTERVAL);
export_symbol(add_timer, SYMBOL_ADD_TIMER);
diff --git a/src/common/socket.c b/src/common/socket.c
index beb658144..e8c4f68ab 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1076,7 +1076,7 @@ int RFIFOSKIP(int fd,int len)
s = session[fd];
- if ( s->rdata_size - s->rdata_pos - len < 0 ) {
+ if ( s->rdata_size < s->rdata_pos + len ) {
//fprintf(stderr,"too many skip\n");
//exit(1);
//better than a COMPLETE program abort // TEST! :)
diff --git a/src/common/timer.c b/src/common/timer.c
index c7be0ab8f..6c228839c 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -270,10 +270,12 @@ int add_timer_interval(unsigned int tick, TimerFunc func, int id, int data, int
return tid;
}
-int delete_timer(int id, TimerFunc func)
+//int delete_timer(int id, TimerFunc func)
+int delete_timer_sub(int id, TimerFunc func, const char* file, int line)
{
if (id <= 0 || id >= timer_data_num) {
- ShowError("delete_timer error : no such timer %d (%08x(%s))\n", id, (int)func, search_timer_func_list(func));
+ //ShowError("delete_timer error : no such timer %d (%08x(%s))\n", id, (int)func, search_timer_func_list(func));
+ ShowError("delete_timer error : no such timer %d (%08x(%s)), invoked from %s:%d\n", id, (int)func, search_timer_func_list(func), file, line);
return -1;
}
if (timer_data[id].func != func) {
diff --git a/src/common/timer.h b/src/common/timer.h
index 243b12e7d..4b683d966 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -41,7 +41,9 @@ unsigned int gettick(void);
int add_timer(unsigned int,TimerFunc f,int,int);
int add_timer_interval(unsigned int tick, TimerFunc func, int id, int data, int interval);
-int delete_timer(int,TimerFunc f);
+//int delete_timer(int,TimerFunc f);
+int delete_timer_sub(int,TimerFunc f, const char* file, int line);
+#define delete_timer(id, f) delete_timer_sub(id, f, __FILE__, __LINE__)
int addtick_timer(int tid,unsigned int tick);
int settick_timer(int tid,unsigned int tick);
diff --git a/src/map/skill.c b/src/map/skill.c
index 2d5bd6566..c144b4c5d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -3217,6 +3217,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
sd->splash_range, BL_CHAR,
src, skillid, skilllv, tick, flag | BCT_ENEMY | 1,
skill_castend_damage_id);
+ flag|=1; //Set flag to 1 so ammo is not double-consumed. [Skotlex]
}
}
break;