From b662970da23f356ec05a06f3b10d14cd28d6f276 Mon Sep 17 00:00:00 2001 From: ultramage Date: Fri, 24 Aug 2007 19:38:38 +0000 Subject: 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 --- src/map/mercenary.c | 5 ++--- 1 file 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); -- cgit v1.2.3-60-g2f50