summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-24 19:38:38 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-24 19:38:38 +0000
commitb662970da23f356ec05a06f3b10d14cd28d6f276 (patch)
tree2359a881c14a8a6071124bb24bc89e6a03ad5f9e /src/map
parent66be8e2d2c939c99784302ffb224593f9a888f44 (diff)
downloadhercules-b662970da23f356ec05a06f3b10d14cd28d6f276.tar.gz
hercules-b662970da23f356ec05a06f3b10d14cd28d6f276.tar.bz2
hercules-b662970da23f356ec05a06f3b10d14cd28d6f276.tar.xz
hercules-b662970da23f356ec05a06f3b10d14cd28d6f276.zip
Fixed a rare crash concerning invalid homunculus data and one NULL-pointer.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11075 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mercenary.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index ace039824..8dd63724f 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -603,7 +603,7 @@ int merc_hom_alloc(struct map_session_data *sd, struct s_homunculus *hom)
i = search_homunculusDB_index(hom->class_,HOMUNCULUS_CLASS);
if(i < 0) {
- ShowError("merc_hom_alloc: unknown homunculus class [%d]", hom->class_);
+ ShowError("merc_hom_alloc: unknown class [%d] for homunculus '%s', requesting deletion.\n", hom->class_, hom->name);
sd->status.hom_id = 0;
intif_homunculus_requestdelete(hom->hom_id);
return 1;
@@ -714,8 +714,7 @@ int merc_hom_recv_data(int account_id, struct s_homunculus *sh, int flag)
merc_hom_alloc(sd, sh);
hd = sd->hd;
- if(hd->homunculus.hp && !hd->homunculus.vaporize &&
- hd->bl.prev == NULL && sd->bl.prev != NULL)
+ if(hd && hd->homunculus.hp && !hd->homunculus.vaporize && hd->bl.prev == NULL && sd->bl.prev != NULL)
{
map_addblock(&hd->bl);
clif_spawn(&hd->bl);