summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-30 06:49:51 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-30 06:49:51 +0000
commit97cb8eebed531dda76a2f4015a95823a9540dd0a (patch)
treea461bfd3bf04c0220f62e03e6a4f307f8c11f2b6
parent166cb92fc2767eb8bb77b96062281d07df630561 (diff)
downloadhercules-97cb8eebed531dda76a2f4015a95823a9540dd0a.tar.gz
hercules-97cb8eebed531dda76a2f4015a95823a9540dd0a.tar.bz2
hercules-97cb8eebed531dda76a2f4015a95823a9540dd0a.tar.xz
hercules-97cb8eebed531dda76a2f4015a95823a9540dd0a.zip
* Fixed script command getusers causing 'player not attached' errors when asking for character count in entire server (bugreport:4591, since r14495).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14522 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/script.c18
2 files changed, 11 insertions, 9 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 8525fe027..d0966b029 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,5 +1,7 @@
Date Added
+2010/11/30
+ * Fixed script command getusers causing 'player not attached' errors when asking for character count in entire server (bugreport:4591, since r14495). [Ai4rei]
2010/11/29
* Resolved issues with item delay system. [Ai4rei]
- Fixed random crashes caused by map_session_data corruption due to out-of-bounds access to item_delay array (bugreport:4568, since r14455).
diff --git a/src/map/script.c b/src/map/script.c
index 722214908..e651d4f21 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -8260,18 +8260,18 @@ BUILDIN_FUNC(getusers)
flag = script_getnum(st,2);
- if(flag&0x8)
- {// npc
- bl = map_id2bl(st->oid);
- }
- else if((sd = script_rid2sd(st))!=NULL)
- {// pc
- bl = &sd->bl;
- }
-
switch(flag&0x07)
{
case 0:
+ if(flag&0x8)
+ {// npc
+ bl = map_id2bl(st->oid);
+ }
+ else if((sd = script_rid2sd(st))!=NULL)
+ {// pc
+ bl = &sd->bl;
+ }
+
if(bl)
{
val = map[bl->m].users;