diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-01 06:26:20 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-01 06:26:20 +0000 |
commit | 436240246bcf3f5368b08f709e1c0774f1f98607 (patch) | |
tree | 678cab558047d098e1d4a389492277c160762399 /src/map | |
parent | b312e82a6f660481c7c43b695452f6bcc0917c27 (diff) | |
download | hercules-436240246bcf3f5368b08f709e1c0774f1f98607.tar.gz hercules-436240246bcf3f5368b08f709e1c0774f1f98607.tar.bz2 hercules-436240246bcf3f5368b08f709e1c0774f1f98607.tar.xz hercules-436240246bcf3f5368b08f709e1c0774f1f98607.zip |
- Cleaned up and fixed @where command.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5840 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 9ce2c3867..9cd75df42 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1285,8 +1285,9 @@ int atcommand_where( const char* command, const char* message)
{
struct map_session_data *pl_sd = NULL;
-
int GM_level, pl_GM_level;
+
+ nullpo_retr(-1, sd);
memset(atcmd_player_name, '\0', sizeof atcmd_player_name);
if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) {
@@ -1294,27 +1295,28 @@ int atcommand_where( return -1;
}
pl_sd = map_nick2sd(atcmd_player_name);
- nullpo_retr(-1, sd);
+ pl_sd = map_nick2sd(atcmd_player_name);
+
if (pl_sd == NULL)
return -1;
- if(strncmp(sd->status.name,atcmd_player_name,NAME_LENGTH)!=0)
+ if(strncmp(pl_sd->status.name,atcmd_player_name,NAME_LENGTH)!=0)
return -1;
GM_level = pc_isGM(sd);//also hide gms depending on settings in battle_athena.conf, show if they are aid [Kevin]
pl_GM_level = pc_isGM(pl_sd);
if (battle_config.hide_GM_session) {
- if(!(GM_level >= pl_GM_level)) {
- if (!(battle_config.who_display_aid > 0 && pc_isGM(sd) >= battle_config.who_display_aid)) {
+ if(GM_level < pl_GM_level) {
+ if (!(battle_config.who_display_aid && GM_level >= battle_config.who_display_aid)) {
return -1;
}
}
}
snprintf(atcmd_output, sizeof atcmd_output, "%s %s %d %d",
- atcmd_player_name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
+ pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
clif_displaymessage(fd, atcmd_output);
return 0;
|