summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-10 06:27:20 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-10 06:27:20 +0000
commitf524249033d191ad5605a878c95cbfe80d645ecb (patch)
tree9c859e7539f21900b94830b115c6e4e19cceef16 /src/map
parent706900718d474b836d231d4df865b14f738923bc (diff)
downloadhercules-f524249033d191ad5605a878c95cbfe80d645ecb.tar.gz
hercules-f524249033d191ad5605a878c95cbfe80d645ecb.tar.bz2
hercules-f524249033d191ad5605a878c95cbfe80d645ecb.tar.xz
hercules-f524249033d191ad5605a878c95cbfe80d645ecb.zip
Fixed @showmobs not working due to a mistake in r12436 (bugreport:1487)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12699 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c90
1 files changed, 46 insertions, 44 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 239f1aa32..9bf6b710f 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6990,76 +6990,78 @@ int atshowmobs_timer(int tid, unsigned int tick, int id, intptr data)
if( sd == NULL )
return 0;
+ // remove indicator
clif_viewpoint(sd, 1, 2, 0, 0, (int)data, 0xFFFFFF);
return 1;
}
+
static int atshowmobs_sub(struct block_list *bl,va_list ap)
{
- int mob_id,fd;
- struct map_session_data* sd;
- static int number=0;
- struct mob_data *md;
+ int mob_id;
+ struct map_session_data* sd;
+ static int number=0;
+ struct mob_data *md;
- if(!ap){
- number=0;
- return 0;
- }
- mob_id = va_arg(ap,int);
- fd = va_arg(ap,int);
- sd = va_arg(ap,struct map_session_data*);
+ if(!ap){
+ number=0;
+ return 0;
+ }
+ mob_id = va_arg(ap,int);
+ sd = va_arg(ap,struct map_session_data*);
- md = (struct mob_data *)bl;
+ md = (struct mob_data *)bl;
if(md->special_state.ai || md->master_id)
return 0; //Hide slaves and player summoned mobs. [Skotlex]
- if(fd && (mob_id==-1 || (md->class_==mob_id))){
- clif_viewpoint(sd, 1, 1, bl->x, bl->y, ++number, 0xFFFFFF);
- add_timer(gettick()+5000, atshowmobs_timer, fd, number);
- }
- return 0;
+ if(mob_id==-1 || md->class_==mob_id){
+ clif_viewpoint(sd, 1, 1, bl->x, bl->y, ++number, 0xFFFFFF);
+ add_timer(gettick()+5000, atshowmobs_timer, sd->bl.id, number);
+ }
+ return 0;
}
+
int atcommand_showmobs(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
- char mob_name[100];
- int mob_id,map_id = 0;
+ char mob_name[100];
+ int mob_id,map_id = 0;
- nullpo_retr(-1, sd);
+ nullpo_retr(-1, sd);
- if (sscanf(message, "%99[^\n]", mob_name) < 0)
- return -1;
+ if(sscanf(message, "%99[^\n]", mob_name) < 0)
+ return -1;
- if ((mob_id = atoi(mob_name)) == 0)
- mob_id = mobdb_searchname(mob_name);
- if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
- snprintf(atcmd_output, sizeof atcmd_output, "Invalid mob id %s!",mob_name);
- clif_displaymessage(fd, atcmd_output);
- return 0;
- }
+ if((mob_id = atoi(mob_name)) == 0)
+ mob_id = mobdb_searchname(mob_name);
+ if(mob_id > 0 && mobdb_checkid(mob_id) == 0){
+ snprintf(atcmd_output, sizeof atcmd_output, "Invalid mob id %s!",mob_name);
+ clif_displaymessage(fd, atcmd_output);
+ return 0;
+ }
// Uncomment the following line to show mini-bosses & MVP.
//#define SHOW_MVP
#ifndef SHOW_MVP
- if(mob_db(mob_id)->status.mode&MD_BOSS){
- snprintf(atcmd_output, sizeof atcmd_output, "Can't show Boss mobs!");
- clif_displaymessage(fd, atcmd_output);
- return 0;
- }
+ if(mob_db(mob_id)->status.mode&MD_BOSS){
+ snprintf(atcmd_output, sizeof atcmd_output, "Can't show Boss mobs!");
+ clif_displaymessage(fd, atcmd_output);
+ return 0;
+ }
#endif
- if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname)
- strcpy(mob_name,mob_db(mob_id)->jname); // --ja--
-// strcpy(mob_name,mob_db(mob_id)->name); // --en--
+ if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname)
+ strcpy(mob_name,mob_db(mob_id)->jname); // --ja--
+ //strcpy(mob_name,mob_db(mob_id)->name); // --en--
- map_id = sd->bl.m;
+ map_id = sd->bl.m;
- snprintf(atcmd_output, sizeof atcmd_output, "Mob Search... %s %s",
- mob_name, mapindex_id2name(sd->mapindex));
- clif_displaymessage(fd, atcmd_output);
+ snprintf(atcmd_output, sizeof atcmd_output, "Mob Search... %s %s",
+ mob_name, mapindex_id2name(sd->mapindex));
+ clif_displaymessage(fd, atcmd_output);
- map_foreachinmap(atshowmobs_sub, map_id, BL_MOB, mob_id, fd, sd);
+ map_foreachinmap(atshowmobs_sub, map_id, BL_MOB, mob_id, sd);
- atshowmobs_sub(&sd->bl,0);
+ atshowmobs_sub(&sd->bl,0);
- return 0;
+ return 0;
}
/*==========================================