summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-29 20:11:12 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-11-29 20:11:12 +0000
commitc2e9dc776639a58be9c073e4deeabb231d326297 (patch)
treec064989352a43f9ec0dab5e5c2932d580a919d7c /src/map/script.c
parent04190264ba7007c84a69b21ac65b3779841cc04b (diff)
downloadhercules-c2e9dc776639a58be9c073e4deeabb231d326297.tar.gz
hercules-c2e9dc776639a58be9c073e4deeabb231d326297.tar.bz2
hercules-c2e9dc776639a58be9c073e4deeabb231d326297.tar.xz
hercules-c2e9dc776639a58be9c073e4deeabb231d326297.zip
- Added overflow protection to @main whisper parsing.
- Fixed a bug in slaves_inherit_speed - Miscellanous silly cleanups (format, unnecessary assignments, comments, etc) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9367 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 350fcabbf..2d1cf68f0 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7429,36 +7429,36 @@ int buildin_getusersname(struct script_state *st)
}
return 0;
}
-/*==========================================
- * getmapguildusers("mapname.gat",guild ID) Returns the number guild members present on a map [Reddozen]
- *------------------------------------------
- */
-int buildin_getmapguildusers(struct script_state *st) {
- char *str;
- int m, gid;
- int i=0,c=0;
- struct guild *g = NULL;
- str=conv_str(st, &(st->stack->stack_data[st->start+2]));
- gid=conv_num(st, &(st->stack->stack_data[st->start+3]));
- if ((m = map_mapname2mapid(str)) < 0) { // map id on this server (m == -1 if not in actual map-server)
- push_val(st->stack, C_INT, -1);
- return 0;
- }
- g = guild_search(gid);
-
- if (g){
- for(i = 0; i < g->max_member; i++)
- {
- if (g->member[i].sd )
- {
- if(g->member[i].sd->bl.m == m)
- c++;
- }
- }
- }
-
- push_val(st->stack, C_INT, c);
- return 0;
+/*==========================================
+ * getmapguildusers("mapname.gat",guild ID) Returns the number guild members present on a map [Reddozen]
+ *------------------------------------------
+ */
+int buildin_getmapguildusers(struct script_state *st) {
+ char *str;
+ int m, gid;
+ int i=0,c=0;
+ struct guild *g = NULL;
+ str=conv_str(st, &(st->stack->stack_data[st->start+2]));
+ gid=conv_num(st, &(st->stack->stack_data[st->start+3]));
+ if ((m = map_mapname2mapid(str)) < 0) { // map id on this server (m == -1 if not in actual map-server)
+ push_val(st->stack, C_INT, -1);
+ return 0;
+ }
+ g = guild_search(gid);
+
+ if (g){
+ for(i = 0; i < g->max_member; i++)
+ {
+ if (g->member[i].sd )
+ {
+ if(g->member[i].sd->bl.m == m)
+ c++;
+ }
+ }
+ }
+
+ push_val(st->stack, C_INT, c);
+ return 0;
}
/*==========================================
* マップ指定ユーザー数所得