summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-04 14:10:14 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-04 14:10:14 +0000
commit2d5e8b6e1a67df8c0719e744211a188f9c855445 (patch)
tree4e6118dfb3785efb9a4657db0b3d559b26ee638d /src/map/script.c
parenta933e1dd3618225e7bb3565bad3c0aa2b42907ad (diff)
downloadhercules-2d5e8b6e1a67df8c0719e744211a188f9c855445.tar.gz
hercules-2d5e8b6e1a67df8c0719e744211a188f9c855445.tar.bz2
hercules-2d5e8b6e1a67df8c0719e744211a188f9c855445.tar.xz
hercules-2d5e8b6e1a67df8c0719e744211a188f9c855445.zip
- Some cleanup of how mobcount works.
- status_calc_misc will now be invoked in status_calc_bl even on the first call, since status could have gone up due to skill bonuses. - Moved max HP/SP calculations to before invoking status_calc_misc - Simplified distance and check_distance to use "aegis" methods (greater of dx/dy = distance), there's a new define in map.h called CIRCULAR_AREA, when set, the previous method is used, and map for each in range calls will also check for distances, making most ground skills and battle system use real circles instead of squares. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8609 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c
index e497430ef..fea3661dd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9100,17 +9100,15 @@ int buildin_stoptimer(struct script_state *st) // Added by RoVeRT
int buildin_mobcount_sub(struct block_list *bl,va_list ap) // Added by RoVeRT
{
char *event=va_arg(ap,char *);
- int *c=va_arg(ap,int *);
-
if(strcmp(event,((struct mob_data *)bl)->npc_event)==0)
- (*c)++;
+ return 1;
return 0;
}
int buildin_mobcount(struct script_state *st) // Added by RoVeRT
{
char *mapname,*event;
- int m,c=0;
+ int m;
mapname=conv_str(st,& (st->stack->stack_data[st->start+2]));
event=conv_str(st,& (st->stack->stack_data[st->start+3]));
check_event(st, event);
@@ -9119,9 +9117,8 @@ int buildin_mobcount(struct script_state *st) // Added by RoVeRT
push_val(st->stack,C_INT,-1);
return 0;
}
- map_foreachinmap(buildin_mobcount_sub, m, BL_MOB, event,&c );
- push_val(st->stack,C_INT, (c));
+ push_val(st->stack,C_INT,map_foreachinmap(buildin_mobcount_sub, m, BL_MOB, event));
return 0;
}