summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 21:15:57 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 21:15:57 +0000
commita6ba6ca70419e7f6db413c3581aee6e90dc87b0a (patch)
tree8f7f1e068fc2f9bae7e7ff041eb8c3dc83e0e887 /src/map/script.c
parentb1d22b02963b16c4edcce0cd5d2bc521d97348f9 (diff)
downloadhercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.tar.gz
hercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.tar.bz2
hercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.tar.xz
hercules-a6ba6ca70419e7f6db413c3581aee6e90dc87b0a.zip
- Fixed the server crashing on startup due to bad define
- Fixed the server crashing on a timer-queued disguise / undisguise (no sd check) - re-added the item_group_list for consistency's sake, moved to itemdb.h (after some hacking to remove the ugly map.h dependency) - Removed some overly verbose item group messages & code git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10112 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 513d3be6f..b0f582b58 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10134,33 +10134,32 @@ BUILDIN_FUNC(clearitem)
}
/*==========================================
- Disguise Player (returns Mob/NPC ID if success, 0 on fail) [Lupus]
- *------------------------------------------
- */
+ * Disguise Player (returns Mob/NPC ID if success, 0 on fail)
+ *------------------------------------------*/
BUILDIN_FUNC(disguise)
{
- struct map_session_data *sd=script_rid2sd(st);
int id;
+ struct map_session_data* sd = script_rid2sd(st);
+ if (sd == NULL) return 0;
- id = script_getnum(st,2);
+ id = script_getnum(st,2);
- if (!mobdb_checkid(id) && !npcdb_checkid(id)) {
+ if (mobdb_checkid(id) || npcdb_checkid(id)) {
+ pc_disguise(sd, id);
+ script_pushint(st,id);
+ } else
script_pushint(st,0);
- return 0;
- }
- pc_disguise(sd, id);
- script_pushint(st,id);
return 0;
}
/*==========================================
- Undisguise Player (returns 1 if success, 0 on fail) [Lupus]
- *------------------------------------------
- */
+ * Undisguise Player (returns 1 if success, 0 on fail)
+ *------------------------------------------*/
BUILDIN_FUNC(undisguise)
{
- struct map_session_data *sd=script_rid2sd(st);
+ struct map_session_data* sd = script_rid2sd(st);
+ if (sd == NULL) return 0;
if (sd->disguise) {
pc_disguise(sd, 0);