summaryrefslogtreecommitdiff
path: root/src/map/npc_chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/npc_chat.c')
-rw-r--r--src/map/npc_chat.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index 8950df1ee..db300e362 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -339,15 +339,20 @@ void npc_chat_finalize(struct npc_data* nd)
*/
int npc_chat_sub(struct block_list* bl, va_list ap)
{
- struct npc_data *nd = (struct npc_data *) bl;
- struct npc_parse *npcParse = nd->chatdb;
- char* msg;
+ struct npc_data *nd = NULL;
+ struct npc_parse *npcParse = NULL;
+ char *msg;
int len, i;
struct map_session_data* sd;
struct npc_label_list* lst;
struct pcrematch_set* pcreset;
struct pcrematch_entry* e;
+ nullpo_ret(bl);
+ Assert_ret(bl->type == BL_NPC);
+ nd = BL_UCAST(BL_NPC, bl);
+ npcParse = nd->chatdb;
+
// Not interested in anything you might have to say...
if (npcParse == NULL || npcParse->active == NULL)
return 0;